changeset 8202:5af44bd71254 libavcodec

Add known BMP header sizes. Now 11B*.bmp from samples repository can be decoded.
author kostya
date Mon, 24 Nov 2008 10:53:13 +0000
parents c6e2ffef3797
children 3b90f93d97a6
files bmp.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bmp.c	Mon Nov 24 09:28:55 2008 +0000
+++ b/bmp.c	Mon Nov 24 10:53:13 2008 +0000
@@ -85,13 +85,19 @@
         return -1;
     }
 
-    if (ihsize == 40) {
+    switch(ihsize){
+    case  40: // windib v3
+    case  64: // OS/2 v2
+    case 108: // windib v4
+    case 124: // windib v5
         width = bytestream_get_le32(&buf);
         height = bytestream_get_le32(&buf);
-    } else if (ihsize == 12) {
+        break;
+    case  12: // OS/2 v1
         width  = bytestream_get_le16(&buf);
         height = bytestream_get_le16(&buf);
-    } else {
+        break;
+    default:
         av_log(avctx, AV_LOG_ERROR, "unsupported BMP file, patch welcome\n");
         return -1;
     }