File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1677,16 +1677,15 @@ static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception)
16771677 /*
16781678 Initialize image structure.
16791679 */
1680- if (ReadDDSInfo (image , & dds_info ) != MagickTrue ) {
1680+ if (ReadDDSInfo (image , & dds_info ) != MagickTrue )
16811681 ThrowReaderException (CorruptImageError ,"ImproperImageHeader" );
1682- }
1683-
1682+
16841683 if (dds_info .ddscaps2 & DDSCAPS2_CUBEMAP )
16851684 cubemap = MagickTrue ;
1686-
1685+
16871686 if (dds_info .ddscaps2 & DDSCAPS2_VOLUME && dds_info .depth > 0 )
16881687 volume = MagickTrue ;
1689-
1688+
16901689 (void ) SeekBlob (image , 128 , SEEK_SET );
16911690
16921691 /*
@@ -1775,7 +1774,10 @@ static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception)
17751774
17761775 if (volume )
17771776 num_images = dds_info .depth ;
1778-
1777+
1778+ if (num_images < 1 )
1779+ ThrowReaderException (CorruptImageError ,"ImproperImageHeader" );
1780+
17791781 for (n = 0 ; n < num_images ; n ++ )
17801782 {
17811783 if (n != 0 )
You can’t perform that action at this time.
0 commit comments