parent
e17fc1dda9
commit
6e1c408829
@ -0,0 +1,37 @@
|
|||||||
|
# HG changeset patch
|
||||||
|
# User Bob Friesenhahn <bfriesen@GraphicsMagick.org>
|
||||||
|
# Date 1487905610 21600
|
||||||
|
# Thu Feb 23 21:06:50 2017 -0600
|
||||||
|
# Node ID 6156b4c2992d855ece6079653b3b93c3229fc4b8
|
||||||
|
# Parent 0392c4305a4369984ec8069055acc470c0a73647
|
||||||
|
Fix out of bounds access when reading CMYKA tiff which claims wrong samples/pixel.
|
||||||
|
|
||||||
|
diff --git a/coders/tiff.c b/coders/tiff.c
|
||||||
|
--- a/coders/tiff.c
|
||||||
|
+++ b/coders/tiff.c
|
||||||
|
@@ -1230,8 +1230,8 @@
|
||||||
|
case 0:
|
||||||
|
if (samples_per_pixel == 1)
|
||||||
|
*quantum_type=GrayQuantum;
|
||||||
|
- else
|
||||||
|
- *quantum_type=RedQuantum;
|
||||||
|
+ else
|
||||||
|
+ *quantum_type=RedQuantum;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
*quantum_type=GreenQuantum;
|
||||||
|
@@ -1411,12 +1411,12 @@
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- if (image->matte)
|
||||||
|
+ if (image->matte && samples_per_pixel >= 5)
|
||||||
|
{
|
||||||
|
*quantum_type=CMYKAQuantum;
|
||||||
|
*quantum_samples=5;
|
||||||
|
}
|
||||||
|
- else
|
||||||
|
+ else if (samples_per_pixel >= 4)
|
||||||
|
{
|
||||||
|
*quantum_type=CMYKQuantum;
|
||||||
|
*quantum_samples=4;
|
Loading…
Reference in new issue