[FFmpeg-cvslog] r12815 - trunk/libavcodec/bmp.c

benoit subversion
Mon Apr 14 15:13:08 CEST 2008


Author: benoit
Date: Mon Apr 14 15:13:08 2008
New Revision: 12815

Log:
Support for BMP os2v1.


Modified:
   trunk/libavcodec/bmp.c

Modified: trunk/libavcodec/bmp.c
==============================================================================
--- trunk/libavcodec/bmp.c	(original)
+++ trunk/libavcodec/bmp.c	Mon Apr 14 15:13:08 2008
@@ -84,8 +84,16 @@ static int bmp_decode_frame(AVCodecConte
         return -1;
     }
 
+    if (ihsize == 40) {
     width = bytestream_get_le32(&buf);
     height = bytestream_get_le32(&buf);
+    } else if (ihsize == 12) {
+        width  = bytestream_get_le16(&buf);
+        height = bytestream_get_le16(&buf);
+    } else {
+        av_log(avctx, AV_LOG_ERROR, "unsupported BMP file, patch welcome");
+        return -1;
+    }
 
     if(bytestream_get_le16(&buf) != 1){ /* planes */
         av_log(avctx, AV_LOG_ERROR, "invalid BMP header\n");
@@ -94,7 +102,7 @@ static int bmp_decode_frame(AVCodecConte
 
     depth = bytestream_get_le16(&buf);
 
-    if(ihsize > 16)
+    if(ihsize == 40)
         comp = bytestream_get_le32(&buf);
     else
         comp = BMP_RGB;




More information about the ffmpeg-cvslog mailing list