aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2008-11-24 10:53:13 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2008-11-24 10:53:13 +0000
commit4a14e666056e430298616b5d5ffa8c57cf609465 (patch)
tree5a28774c4712726fb7a77bb6102c418732452333 /libavcodec
parent4deaa94639148297cef58d35bc25ebcab45e9111 (diff)
downloadffmpeg-4a14e666056e430298616b5d5ffa8c57cf609465.tar.gz
Add known BMP header sizes.
Now 11B*.bmp from samples repository can be decoded. Originally committed as revision 15922 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/bmp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index ca2e201b54..f4205c9973 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -85,13 +85,19 @@ static int bmp_decode_frame(AVCodecContext *avctx,
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;
}