diff options
author | Cristy <mikayla-grace@urban-warrior.org> | 2019-04-12 07:45:29 -0400 |
---|---|---|
committer | Cristy <mikayla-grace@urban-warrior.org> | 2019-04-12 07:45:29 -0400 |
commit | f5414a515cdbc087c44d023f09cb04a3b89a5ab6 (patch) | |
tree | c9d184173678979d8a27761624074072a4649a0f /coders/mat.c | |
parent | 9d5932c296b2629f38c971a5fd94cacad6827877 (diff) | |
download | ImageMagick-f5414a515cdbc087c44d023f09cb04a3b89a5ab6.tar.gz |
...
Diffstat (limited to 'coders/mat.c')
-rw-r--r-- | coders/mat.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/coders/mat.c b/coders/mat.c index ba4425cbe..1332d18b6 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -1695,13 +1695,21 @@ static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image, for (y=0; y < (ssize_t)image->columns; y++) { + size_t + length; + p=GetVirtualPixels(image,y,0,1,image->rows,exception); if (p == (const Quantum *) NULL) break; - (void) ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, + length=ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, z2qtype[z],pixels,exception); - (void) WriteBlob(image,image->rows,pixels); + if (length != image->columns) + break; + if (WriteBlob(image,image->rows,pixels) != image->rows) + break; } + if (y < (ssize_t) image->columns) + break; if (SyncAuthenticPixels(image,exception) == MagickFalse) break; } while (z-- >= 2); |