Convert PNM pixels to runextent-encoded MIFF packets.
*/
row=0;
+ y=0;
switch (format)
{
case '1':
size_t
length;
- if (status == MagickFalse)
- continue;
pixels=(unsigned char *) ReadBlobStream(image,extent,
GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
- status=MagickFalse;
+ break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
(image->previous == (Image *) NULL))
{
proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
row,image->rows);
if (proceed == MagickFalse)
- status=MagickFalse;
+ break;
}
offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
- {
- status=MagickFalse;
- continue;
- }
+ break;
length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
quantum_type,pixels,exception);
if (length != extent)
- status=MagickFalse;
+ break;
sync=SyncAuthenticPixels(image,exception);
if (sync == MagickFalse)
- status=MagickFalse;
+ break;
}
quantum_info=DestroyQuantumInfo(quantum_info);
- if (status == MagickFalse)
- ThrowReaderException(CorruptImageError,"UnableToReadImageData");
SetQuantumImageType(image,quantum_type);
break;
}
count,
offset;
- if (status == MagickFalse)
- continue;
pixels=(unsigned char *) ReadBlobStream(image,extent,
GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
- status=MagickFalse;
+ break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
(image->previous == (Image *) NULL))
{
proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
row,image->rows);
if (proceed == MagickFalse)
- status=MagickFalse;
+ break;
}
offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
- {
- status=MagickFalse;
- continue;
- }
+ break;
p=pixels;
switch (image->depth)
{
}
sync=SyncAuthenticPixels(image,exception);
if (sync == MagickFalse)
- status=MagickFalse;
+ break;
}
quantum_info=DestroyQuantumInfo(quantum_info);
- if (status == MagickFalse)
- ThrowReaderException(CorruptImageError,"UnableToReadImageData");
SetQuantumImageType(image,quantum_type);
break;
}
count,
offset;
- if (status == MagickFalse)
- continue;
pixels=(unsigned char *) ReadBlobStream(image,extent,
GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
- status=MagickFalse;
+ break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
(image->previous == (Image *) NULL))
{
proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
row,image->rows);
if (proceed == MagickFalse)
- status=MagickFalse;
+ break;
}
offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
- {
- status=MagickFalse;
- continue;
- }
+ break;
p=pixels;
switch (image->depth)
{
}
sync=SyncAuthenticPixels(image,exception);
if (sync == MagickFalse)
- status=MagickFalse;
+ break;
}
quantum_info=DestroyQuantumInfo(quantum_info);
- if (status == MagickFalse)
- ThrowReaderException(CorruptImageError,"UnableToReadImageData");
break;
}
case '7':
count,
offset;
- if (status == MagickFalse)
- continue;
pixels=(unsigned char *) ReadBlobStream(image,extent,
GetQuantumPixels(quantum_info),&count);
if (count != (ssize_t) extent)
- status=MagickFalse;
+ break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
(image->previous == (Image *) NULL))
{
proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
row,image->rows);
if (proceed == MagickFalse)
- status=MagickFalse;
+ break;
}
offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
- {
- status=MagickFalse;
- continue;
- }
+ break;
p=pixels;
switch (image->depth)
{
}
sync=SyncAuthenticPixels(image,exception);
if (sync == MagickFalse)
- status=MagickFalse;
+ break;
}
quantum_info=DestroyQuantumInfo(quantum_info);
- if (status == MagickFalse)
- ThrowReaderException(CorruptImageError,"UnableToReadImageData");
SetQuantumImageType(image,quantum_type);
break;
}
size_t
length;
- if (status == MagickFalse)
- continue;
pixels=(unsigned char *) ReadBlobStream(image,extent,
GetQuantumPixels(quantum_info),&count);
if ((size_t) count != extent)
- status=MagickFalse;
+ break;
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
(image->previous == (Image *) NULL))
{
proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
row,image->rows);
if (proceed == MagickFalse)
- status=MagickFalse;
+ break;
}
offset=row++;
q=QueueAuthenticPixels(image,0,(ssize_t) (image->rows-offset-1),
image->columns,1,exception);
if (q == (Quantum *) NULL)
- {
- status=MagickFalse;
- continue;
- }
+ break;
length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
quantum_type,pixels,exception);
if (length != extent)
- status=MagickFalse;
+ break;
sync=SyncAuthenticPixels(image,exception);
if (sync == MagickFalse)
- status=MagickFalse;
+ break;
}
quantum_info=DestroyQuantumInfo(quantum_info);
- if (status == MagickFalse)
- ThrowReaderException(CorruptImageError,"UnableToReadImageData");
SetQuantumImageType(image,quantum_type);
break;
}
default:
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
}
+ if (y < (ssize_t) image->rows)
+ ThrowReaderException(CorruptImageError,"UnableToReadImageData");
if (EOFBlob(image) != MagickFalse)
{
(void) ThrowMagickException(exception,GetMagickModule(),