...
diff --git a/coders/bgr.c b/coders/bgr.c
index 1998b41..f8b96d4 100644
--- a/coders/bgr.c
+++ b/coders/bgr.c
@@ -223,6 +223,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -282,6 +284,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
break;
}
@@ -304,6 +308,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -383,6 +389,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -404,6 +412,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -451,6 +461,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -504,6 +516,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -557,6 +571,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -619,6 +635,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -666,6 +684,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -712,6 +732,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -743,6 +765,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -789,6 +813,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -820,6 +846,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -866,6 +894,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -899,6 +929,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -945,6 +977,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
diff --git a/coders/cmyk.c b/coders/cmyk.c
index cbe9501..f8ab31d 100644
--- a/coders/cmyk.c
+++ b/coders/cmyk.c
@@ -222,6 +222,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -282,6 +284,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
break;
}
@@ -305,6 +309,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -384,6 +390,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -405,6 +413,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -452,6 +462,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -505,6 +517,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -558,6 +572,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -611,6 +627,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -667,6 +685,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -715,6 +735,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -761,6 +783,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -793,6 +817,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -839,6 +865,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -871,6 +899,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -918,6 +948,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -950,6 +982,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -997,6 +1031,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -1030,8 +1066,9 @@
}
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
- GetQuantumPixels(quantum_info),
- &count);
+ GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -1079,6 +1116,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
diff --git a/coders/cut.c b/coders/cut.c
index fc6af54..d127e23 100644
--- a/coders/cut.c
+++ b/coders/cut.c
@@ -208,7 +208,8 @@
case 8: /* Convert PseudoColor scanline. */
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (Quantum *) NULL) break;
+ if (q == (Quantum *) NULL)
+ break;
for (x=0; x < (ssize_t) image->columns; x++)
{
index=ConstrainColormapIndex(image,*p,exception);
diff --git a/coders/gray.c b/coders/gray.c
index 865c37a..df0f0ab 100644
--- a/coders/gray.c
+++ b/coders/gray.c
@@ -202,6 +202,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -255,6 +257,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
SetQuantumImageType(image,quantum_type);
/*
diff --git a/coders/pnm.c b/coders/pnm.c
index 82f2fda..d5f39d1 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -1282,7 +1282,7 @@
pixels=(unsigned char *) ReadBlobStream(image,extent,
GetQuantumPixels(quantum_info),&count);
- if ((size_t) count != extent)
+ if (count != (ssize_t) extent)
break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
(image->previous == (Image *) NULL))
diff --git a/coders/raw.c b/coders/raw.c
index d6fe296..dd2e430 100644
--- a/coders/raw.c
+++ b/coders/raw.c
@@ -200,6 +200,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -255,6 +257,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
SetQuantumImageType(image,quantum_type);
/*
diff --git a/coders/rgb.c b/coders/rgb.c
index a81789a..6f3dd3c 100644
--- a/coders/rgb.c
+++ b/coders/rgb.c
@@ -222,6 +222,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -280,6 +282,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
break;
}
@@ -304,6 +308,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -382,6 +388,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -403,6 +411,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -449,6 +459,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -501,6 +513,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -553,6 +567,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -614,6 +630,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -661,6 +679,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -706,6 +726,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -737,6 +759,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -782,6 +806,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -813,6 +839,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -858,6 +886,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -891,6 +921,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
@@ -936,6 +968,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
diff --git a/coders/ycbcr.c b/coders/ycbcr.c
index 1ecaa3b..775948e 100644
--- a/coders/ycbcr.c
+++ b/coders/ycbcr.c
@@ -229,6 +229,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -279,6 +281,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
break;
}
@@ -301,6 +305,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -367,6 +373,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -388,6 +396,8 @@
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -427,6 +437,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -472,6 +484,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -517,6 +531,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -565,6 +581,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -651,6 +669,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -683,6 +703,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (count != (ssize_t) length)
@@ -721,6 +743,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -753,6 +777,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (count != (ssize_t) length)
@@ -791,6 +817,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{
@@ -825,6 +853,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (count != (ssize_t) length)
@@ -864,6 +894,8 @@
}
pixels=(const unsigned char *) ReadBlobStream(image,length,
GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
+ break;
}
if (image->previous == (Image *) NULL)
{