diff --git a/ImageMagick-uninitialized-memory.patch b/ImageMagick-uninitialized-memory.patch new file mode 100644 index 0000000..57a0017 --- /dev/null +++ b/ImageMagick-uninitialized-memory.patch @@ -0,0 +1,165 @@ +http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=22586 +Index: ImageMagick-6.7.8-8/coders/mat.c +=================================================================== +--- ImageMagick-6.7.8-8.orig/coders/mat.c ++++ ImageMagick-6.7.8-8/coders/mat.c +@@ -897,7 +897,7 @@ NEXT_FRAME: + { + for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++) + { +- q=QueueAuthenticPixels(image,0,MATLAB_HDR.SizeY-i-1,image->columns,1,exception); ++ q=GetAuthenticPixels(image,0,MATLAB_HDR.SizeY-i-1,image->columns,1,exception); + if (q == (PixelPacket *)NULL) + { + if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), +Index: ImageMagick-6.7.8-8/magick/quantum-import.c +=================================================================== +--- ImageMagick-6.7.8-8.orig/magick/quantum-import.c ++++ ImageMagick-6.7.8-8/magick/quantum-import.c +@@ -1032,62 +1032,86 @@ static void ImportBlueQuantum(const Imag + + switch (quantum_info->depth) + { +- case 10: ++ case 8: + { +- Quantum +- cbcr[4]; ++ unsigned char ++ pixel; + +- pixel=0; +- if (quantum_info->pack == MagickFalse) +- { +- register ssize_t +- i; ++ for (x=0; x < (ssize_t) number_pixels; x++) ++ { ++ p=PushCharPixel(p,&pixel); ++ SetPixelBlue(q,ScaleCharToQuantum(pixel)); ++ p+=quantum_info->pad; ++ q++; ++ } ++ break; ++ } ++ case 16: ++ { ++ unsigned short ++ pixel; + +- size_t +- quantum; ++ if (quantum_info->format == FloatingPointQuantumFormat) ++ { ++ for (x=0; x < (ssize_t) number_pixels; x++) ++ { ++ p=PushShortPixel(quantum_info->endian,p,&pixel); ++ SetPixelBlue(q,ClampToQuantum((MagickRealType) ++ QuantumRange*HalfToSinglePrecision(pixel))); ++ p+=quantum_info->pad; ++ q++; ++ } ++ break; ++ } ++ for (x=0; x < (ssize_t) number_pixels; x++) ++ { ++ p=PushShortPixel(quantum_info->endian,p,&pixel); ++ SetPixelBlue(q,ScaleShortToQuantum(pixel)); ++ p+=quantum_info->pad; ++ q++; ++ } ++ break; ++ } ++ case 32: ++ { ++ unsigned int ++ pixel; + +- ssize_t +- n; ++ if (quantum_info->format == FloatingPointQuantumFormat) ++ { ++ float ++ pixel; + +- n=0; +- quantum=0; +- for (x=0; x < (ssize_t) number_pixels; x+=2) ++ for (x=0; x < (ssize_t) number_pixels; x++) + { +- for (i=0; i < 4; i++) +- { +- switch (n % 3) +- { +- case 0: +- { +- p=PushLongPixel(quantum_info->endian,p,&pixel); +- quantum=(size_t) (ScaleShortToQuantum((unsigned short) +- (((pixel >> 22) & 0x3ff) << 6))); +- break; +- } +- case 1: +- { +- quantum=(size_t) (ScaleShortToQuantum((unsigned short) +- (((pixel >> 12) & 0x3ff) << 6))); +- break; +- } +- case 2: +- { +- quantum=(size_t) (ScaleShortToQuantum((unsigned short) +- (((pixel >> 2) & 0x3ff) << 6))); +- break; +- } +- } +- cbcr[i]=(Quantum) (quantum); +- n++; +- } ++ p=PushFloatPixel(quantum_info,p,&pixel); ++ SetPixelBlue(q,ClampToQuantum(pixel)); + p+=quantum_info->pad; +- SetPixelRed(q,cbcr[1]); +- SetPixelGreen(q,cbcr[0]); +- SetPixelBlue(q,cbcr[2]); + q++; +- SetPixelRed(q,cbcr[3]); +- SetPixelGreen(q,cbcr[0]); +- SetPixelBlue(q,cbcr[2]); ++ } ++ break; ++ } ++ for (x=0; x < (ssize_t) number_pixels; x++) ++ { ++ p=PushLongPixel(quantum_info->endian,p,&pixel); ++ SetPixelBlue(q,ScaleLongToQuantum(pixel)); ++ p+=quantum_info->pad; ++ q++; ++ } ++ break; ++ } ++ case 64: ++ { ++ if (quantum_info->format == FloatingPointQuantumFormat) ++ { ++ double ++ pixel; ++ ++ for (x=0; x < (ssize_t) number_pixels; x++) ++ { ++ p=PushDoublePixel(quantum_info,p,&pixel); ++ SetPixelBlue(q,ClampToQuantum(pixel)); ++ p+=quantum_info->pad; + q++; + } + break; +@@ -1102,9 +1126,8 @@ static void ImportBlueQuantum(const Imag + for (x=0; x < (ssize_t) number_pixels; x++) + { + p=PushQuantumPixel(quantum_info,p,&pixel); +- SetPixelRed(q,ScaleAnyToQuantum(pixel,range)); +- p=PushQuantumPixel(quantum_info,p,&pixel); +- SetPixelGreen(q,ScaleAnyToQuantum(pixel,range)); ++ SetPixelBlue(q,ScaleAnyToQuantum(pixel,range)); ++ p+=quantum_info->pad; + q++; + } + break; diff --git a/ImageMagick.changes b/ImageMagick.changes index e9f7e52..bd89d4b 100644 --- a/ImageMagick.changes +++ b/ImageMagick.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jan 15 17:34:50 UTC 2013 - pgajdos@suse.com + +- fix wrong mean-error output: + http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=22586 + * dropped disable-matlab-test.patch + * added ImageMagick-uninitialized-memory.patch + ------------------------------------------------------------------- Thu Jan 10 16:24:43 UTC 2013 - meissner@suse.com diff --git a/ImageMagick.spec b/ImageMagick.spec index 37c44da..bb43c63 100644 --- a/ImageMagick.spec +++ b/ImageMagick.spec @@ -58,8 +58,9 @@ Source2: baselibs.conf Patch1: ImageMagick-6.6.8.9-examples.patch Patch2: ImageMagick-6.6.8.9-doc.patch Patch3: ImageMagick-6.7.6.1-no-dist-lzip.patch -# Matlab RGB 8bit LSB test fails with MALLOC_PERTURB_=69 checking -Patch4: disable-matlab-test.patch +# will be upstreamed: +# http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=22586 +Patch4: ImageMagick-uninitialized-memory.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %package -n perl-PerlMagick @@ -408,6 +409,8 @@ HTML documentation for ImageMagick library and scene examples. + + diff --git a/disable-matlab-test.patch b/disable-matlab-test.patch deleted file mode 100644 index 82f4e78..0000000 --- a/disable-matlab-test.patch +++ /dev/null @@ -1,27 +0,0 @@ -Index: ImageMagick-6.7.8-8/PerlMagick/t/read.t -=================================================================== ---- ImageMagick-6.7.8-8.orig/PerlMagick/t/read.t -+++ ImageMagick-6.7.8-8/PerlMagick/t/read.t -@@ -15,7 +15,7 @@ - # - # Test reading formats supported directly by ImageMagick. - # --BEGIN { $| = 1; $test=1; print "1..47\n"; } -+BEGIN { $| = 1; $test=1; print "1..46\n"; } - END {print "not ok $test\n" unless $loaded;} - use Image::Magick; - $loaded=1; -@@ -76,9 +76,10 @@ print("MAT (MatLab gray 64-bit LSB doubl - ++$test; - testReadCompare('input_gray_lsb_double.mat', 'reference/read/input_gray_lsb_double_mat.miff', q//, 0.2, 1.02); - --print("MAT (MatLab RGB 8-bit LSB integer) ...\n"); --++$test; --testReadCompare('input_rgb_lsb_08bit.mat', 'reference/read/input_rgb_lsb_08bit_mat.miff', q//, 0.2, 1.02); -+# fails with MALLOC_PERTURB_=69 ... means there is some accessing freed or uninitialized memory in here -+#print("MAT (MatLab RGB 8-bit LSB integer) ...\n"); -+#++$test; -+#testReadCompare('input_rgb_lsb_08bit.mat', 'reference/read/input_rgb_lsb_08bit_mat.miff', q//, 0.2, 1.02); - - print("Microsoft icon ...\n"); - ++$test;