Bugzilla – Attachment 28262 Details for
Bug 65351
VUL-0: CVE-2005-0762: Imagemagick bugs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
ImageMagick-5.5.7-psd-pixel.patch
ImageMagick-5.5.7-psd-pixel.patch (text/x-diff), 9.37 KB, created by
Vladimir Nadvornik
on 2005-02-07 21:37:40 UTC
(
hide
)
Description:
ImageMagick-5.5.7-psd-pixel.patch
Filename:
MIME Type:
Creator:
Vladimir Nadvornik
Created:
2005-02-07 21:37:40 UTC
Size:
9.37 KB
patch
obsolete
>--- coders/psd.c >+++ coders/psd.c >@@ -131,7 +131,7 @@ > { > if (count == -128) > continue; >- pixel=ReadBlobByte(image); >+ pixel=ScaleCharToQuantum(ReadBlobByte(image)); > for (count=(-count+1); count > 0; count--) > { > q=GetImagePixels(image,(long) (x % image->columns), >@@ -143,44 +143,43 @@ > { > case -1: > { >- if (image->colorspace == CMYKColorspace) >- indexes[0]=(Quantum) (MaxRGB-ScaleCharToQuantum(pixel)); >- else >- q->opacity=(Quantum) (MaxRGB-ScaleCharToQuantum(pixel)); >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > case 0: > { >- q->red=ScaleCharToQuantum(pixel); >+ q->red=(Quantum) pixel; > if (image->storage_class == PseudoClass) > { >- indexes[0]=(IndexPacket) pixel; >- *q=image->colormap[pixel]; >+ *indexes=(IndexPacket) ScaleQuantumToChar(pixel); >+ *q=image->colormap[*indexes]; > } > break; > } > case 1: > { > if (image->storage_class == PseudoClass) >- q->opacity=ScaleCharToQuantum(pixel); >+ q->opacity=(Quantum) (MaxRGB-pixel); > else >- q->green=ScaleCharToQuantum(pixel); >+ q->green=(Quantum) pixel; > break; > } > case 2: > { >- q->blue=ScaleCharToQuantum(pixel); >+ q->blue=(Quantum) pixel; > break; > } > case 3: > { >- q->opacity=ScaleCharToQuantum(pixel); >+ if (image->colorspace == CMYKColorspace) >+ *indexes=(Quantum) pixel; >+ else >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > case 4: > { >- if (image->colorspace == CMYKColorspace) >- indexes[0]=(Quantum) (MaxRGB-ScaleCharToQuantum(pixel)); >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > default: >@@ -194,9 +193,9 @@ > continue; > } > count++; >- for (i=count; i > 0; i--) >+ for (i=(long) count; i > 0; i--) > { >- pixel=ReadBlobByte(image); >+ pixel=ScaleCharToQuantum(ReadBlobByte(image)); > q=GetImagePixels(image,(long) (x % image->columns), > (long) (x/image->columns),1,1); > if (q == (PixelPacket *) NULL) >@@ -206,44 +205,43 @@ > { > case -1: > { >- if (image->colorspace == CMYKColorspace) >- indexes[0]=(Quantum) (MaxRGB-ScaleCharToQuantum(pixel)); >- else >- q->opacity=(Quantum) (MaxRGB-ScaleCharToQuantum(pixel)); >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > case 0: > { >- q->red=ScaleCharToQuantum(pixel); >+ q->red=(Quantum) pixel; > if (image->storage_class == PseudoClass) > { >- indexes[0]=(IndexPacket) pixel; >- *q=image->colormap[pixel]; >+ *indexes=(IndexPacket) ScaleQuantumToChar(pixel); >+ *q=image->colormap[*indexes]; > } > break; > } > case 1: > { > if (image->storage_class == PseudoClass) >- q->opacity=ScaleCharToQuantum(pixel); >+ q->opacity=(Quantum) (MaxRGB-pixel); > else >- q->green=ScaleCharToQuantum(pixel); >+ q->green=(Quantum) pixel; > break; > } > case 2: > { >- q->blue=ScaleCharToQuantum(pixel); >+ q->blue=(Quantum) pixel; > break; > } > case 3: > { >- q->opacity=ScaleCharToQuantum(pixel); >+ if (image->colorspace == CMYKColorspace) >+ *indexes=(Quantum) pixel; >+ else >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > case 4: > { >- if (image->colorspace == CMYKColorspace) >- indexes[0]=(Quantum) (MaxRGB-ScaleCharToQuantum(pixel)); >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > default: >@@ -1120,16 +1118,14 @@ > for (x=0; x < (long) layer_info[i].image->columns; x++) > { > if (packet_size == 1) >- pixel=ScaleCharToQuantum(ReadBlobByte(layer_info[i].image)); >+ pixel=ScaleCharToQuantum(ReadBlobByte(layer_info[i].image)); > else >- pixel=ScaleQuantumToShort(ReadBlobMSBShort(layer_info[i].image)); >+ pixel=ScaleShortToQuantum(ReadBlobMSBShort( >+ layer_info[i].image)); > switch (layer_info[i].channel_info[j].type) > { > case -1: /* transparency mask */ > { >- if (image->colorspace == CMYKColorspace) >- indexes[x]=(Quantum) (MaxRGB-pixel); >- else > q->opacity=(Quantum) (MaxRGB-pixel); > break; > } >@@ -1138,7 +1134,10 @@ > q->red=(Quantum) pixel; > if (layer_info[i].image->storage_class == PseudoClass) > { >- indexes[x]=(IndexPacket) MaxRGB - ScaleQuantumToChar(pixel); >+ if (packet_size == 1) >+ indexes[x]=(IndexPacket) ScaleQuantumToChar(pixel); >+ else >+ indexes[x]=(IndexPacket) ScaleQuantumToShort(pixel); > *q=layer_info[i].image->colormap[indexes[x]]; > } > break; >@@ -1146,7 +1145,7 @@ > case 1: /* second component (Green, Magenta, or opacity) */ > { > if (layer_info[i].image->storage_class == PseudoClass) >- q->opacity=(Quantum) pixel; >+ q->opacity=(Quantum) (MaxRGB-pixel); > else > q->green=(Quantum) pixel; > break; >@@ -1158,13 +1157,15 @@ > } > case 3: /* fourth component (Opacity or Black) */ > { >- q->opacity=(Quantum) pixel; >+ if (image->colorspace == CMYKColorspace) >+ indexes[x]=(Quantum) pixel; >+ else >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > case 4: /* fifth component (opacity) */ > { >- if (image->colorspace == CMYKColorspace) >- indexes[x]=(Quantum) (MaxRGB-pixel); >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > default: >@@ -1190,11 +1191,8 @@ > indexes=GetIndexes(layer_info[i].image); > for (x=0; x < (long) layer_info[i].image->columns; x++) > { >- q->opacity=(Quantum) ((unsigned long) >+ q->opacity=MaxRGB-(Quantum) ((unsigned long) > (q->opacity*layer_info[i].opacity)/MaxRGB); >- if (layer_info[i].image->colorspace == CMYKColorspace) >- indexes[x]=(IndexPacket) ((unsigned long) >- (indexes[x]*layer_info[i].opacity)/MaxRGB); > q++; > } > if (!SyncImagePixels(layer_info[i].image)) >@@ -1331,7 +1329,10 @@ > q->red=(Quantum) pixel; > if (image->storage_class == PseudoClass) > { >+ if (packet_size == 1) > indexes[x]=(IndexPacket) ScaleQuantumToChar(pixel); >+ else >+ indexes[x]=(IndexPacket) ScaleQuantumToShort(pixel); > *q=image->colormap[indexes[x]]; > } > break; >@@ -1339,7 +1340,7 @@ > case 1: > { > if (image->storage_class == PseudoClass) >- q->opacity=(Quantum) pixel; >+ q->opacity=(Quantum) (MaxRGB-pixel); > else > q->green=(Quantum) pixel; > break; >@@ -1351,13 +1352,15 @@ > } > case 3: > { >- q->opacity=(Quantum) pixel; >+ if (image->colorspace == CMYKColorspace) >+ indexes[x]=(IndexPacket) pixel; >+ else >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > case 4: > { >- if (image->colorspace == CMYKColorspace) >- indexes[x]=(IndexPacket) pixel; >+ q->opacity=(Quantum) (MaxRGB-pixel); > break; > } > default: >@@ -1380,12 +1383,13 @@ > q=GetImagePixels(image,0,y,image->columns,1); > if (q == (PixelPacket *) NULL) > break; >+ indexes=GetIndexes(image); > for (x=0; x < (long) image->columns; x++) > { > q->red=(Quantum) (MaxRGB-q->red); > q->green=(Quantum) (MaxRGB-q->green); > q->blue=(Quantum) (MaxRGB-q->blue); >- q->opacity=(Quantum) (MaxRGB-q->opacity); >+ indexes[x]=(IndexPacket) (MaxRGB-indexes[x]); > q++; > } > if (!SyncImagePixels(image))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 65351
:
28062
|
28063
|
28064
|
28065
|
28260
|
28261
| 28262 |
28263