]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 1 Feb 2011 15:54:38 +0000 (15:54 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 1 Feb 2011 15:54:38 +0000 (15:54 +0000)
coders/bmp.c
config/english.xml
config/francais.xml

index 98f9213f03f550c333312d74f76fb23b8e1cba99..338e94f5deb54dc1ab0b3bf3769f373b13fbe82d 100644 (file)
@@ -785,10 +785,14 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
             (void) ReadBlobLSBLong(image);  /* Reserved byte */
           }
       }
-    if ((bmp_info.compression != BI_RGB) &&
-        ((MagickSizeType) bmp_info.file_size != GetBlobSize(image)))
+    if ((MagickSizeType) bmp_info.file_size > GetBlobSize(image))
       (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
         "LengthAndFilesizeDoNotMatch","`%s'",image->filename);
+    else
+      if ((MagickSizeType) bmp_info.file_size < GetBlobSize(image))
+        (void) ThrowMagickException(exception,GetMagickModule(),
+          CorruptImageWarning,"LengthAndFilesizeDoNotMatch","`%s'",
+          image->filename);
     if (bmp_info.width <= 0)
       ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize");
     if (bmp_info.height == 0)
index b066737c1f51df065c6771e7297f1ef9948d48f8..6c9a9c32a3bb51506ca786941c8d3505682f848e 100644 (file)
           <message name="InsufficientImageDataInFile">
             insufficient image data in file
           </message>
+          <message name="LengthAndFilesizeDoNotMatch">
+            length and filesize do not match
+          </message>
           <message name="SkipToSyncByte">
             corrupt PCD image, skipping to sync byte
           </message>
index 4f4139ce42a963d3ba9cfeffb3b7f9a036561c32..06af75c3cccc014161a015283c98d21c944e6aed 100644 (file)
           <message name="InsufficientImageDataInFile">
             Pas assez de données d'image dans le fichier
           </message>
+          <message name="LengthAndFilesizeDoNotMatch">
+            Longueur et taille du fichier ne correspondent pas
+          </message>
           <message name="SkipToSyncByte">
             Image PCD corrompue, saut à l'octet de synchronisation
           </message>