|
66 | 66 | #include "MagickCore/profile.h" |
67 | 67 | #include "MagickCore/property.h" |
68 | 68 | #include "MagickCore/quantum-private.h" |
| 69 | +#include "MagickCore/resource.h" |
69 | 70 | #include "MagickCore/static.h" |
70 | 71 | #include "MagickCore/statistic.h" |
71 | 72 | #include "MagickCore/string_.h" |
@@ -834,7 +835,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) |
834 | 835 | /* |
835 | 836 | Create image colormap. |
836 | 837 | */ |
837 | | - if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) |
| 838 | + image->colormap=(PixelInfo *) AcquireQuantumMemory(image->colors+1, |
| 839 | + sizeof(*image->colormap)); |
| 840 | + if (image->colormap == (PixelInfo *) NULL) |
838 | 841 | ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); |
839 | 842 | if (image->colors != 0) |
840 | 843 | { |
@@ -923,9 +926,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) |
923 | 926 | if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0)) |
924 | 927 | if (image->scene >= (image_info->scene+image_info->number_scenes-1)) |
925 | 928 | break; |
926 | | - status=SetImageExtent(image,image->columns,image->rows,exception); |
927 | | - if (status == MagickFalse) |
928 | | - return(DestroyImageList(image)); |
| 929 | + if ((AcquireMagickResource(WidthResource,image->columns) == MagickFalse) || |
| 930 | + (AcquireMagickResource(HeightResource,image->rows) == MagickFalse)) |
| 931 | + ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit"); |
929 | 932 | /* |
930 | 933 | Attach persistent pixel cache. |
931 | 934 | */ |
|
0 commit comments