exr uninitialized memory
Posted: 2013-04-29T03:53:22-07:00
Hi,
I came along an uninitialized memory issue in exr.c. Basically I use exr files that have a data window different than the display window, for instance:
Here is a proposed patch, that could give you some hints of where the issue is located:
Hope it helps,
C
I came along an uninitialized memory issue in exr.c. Basically I use exr files that have a data window different than the display window, for instance:
- exrheader myfile.exr:
...
dataWindow (type box2i): (493 162) - (1541 797)
displayWindow (type box2i): (0 0) - (1919 1079)
...
Here is a proposed patch, that could give you some hints of where the issue is located:
Code: Select all
--- tmp/ImageMagick-6.8.5-3/coders/exr.c
+++ Installs/ImageMagick-6.8.4-10/coders/exr.c
@@ -218,6 +218,7 @@
}
for (y=0; y < (ssize_t) image->rows; y++)
{
+ bzero(scanline, image->columns*sizeof(*scanline));
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (PixelPacket *) NULL)
break;
@@ -427,6 +428,7 @@
(void) ImfCloseOutputFile(file);
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
+ bzero(scanline, image->columns*sizeof(*scanline));
for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
C