diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-24 03:57:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-24 03:57:17 +0400 |
commit | c1c022342cd2fb526f1dfb79ab1d7f5324e90d4e (patch) | |
tree | 32a3d4ab62726cdaef86d826571847e3a1bc58f4 /source/blender/imbuf/intern | |
parent | 03f451f2f18cccd80d0d56391c4836da34641a60 (diff) |
fix for invalid use of memset when loading tiff images
- memset(..., 1.0); // isnt valid
- memset(pointer, sizeof(pointer)) // was using the sizeof the pointer, not the size of the array, since this was to fill in alpha values it was obviously wrong.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index f81fb740ff0..08b2e608c8e 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -439,7 +439,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul) if (bitspersample == 32) { if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */ - memset(fbuf, 1.0, sizeof(fbuf)); + fill_vn_fl(fbuf, ibuf->x, 1.0f); else success |= TIFFReadScanline(image, fbuf, row, chan); scanline_separate_32bit(tmpibuf->rect_float+ib_offset, fbuf, ibuf->x, chan); @@ -447,7 +447,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul) } else if (bitspersample == 16) { if (chan == 3 && spp == 3) /* fill alpha if only RGB TIFF */ - memset(sbuf, 65535, sizeof(sbuf)); + fill_vn_ushort(sbuf, ibuf->x, 65535); else success |= TIFFReadScanline(image, sbuf, row, chan); scanline_separate_16bit(tmpibuf->rect_float+ib_offset, sbuf, ibuf->x, chan); |