aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorBenoit Fouet <benoit.fouet@free.fr>2008-04-14 13:13:08 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2008-04-14 13:13:08 +0000
commitb65213c021c458f104189755ea3ac3e76668b458 (patch)
tree94bba00cb76d4301e0cb119a7c44c20af8a21658 /libavcodec
parent780169c3631034a3be35d412782345d0e3a6f473 (diff)
downloadffmpeg-b65213c021c458f104189755ea3ac3e76668b458.tar.gz
Support for BMP os2v1.
Originally committed as revision 12815 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/bmp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index 52de3be214..de97e6bd3b 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -84,8 +84,16 @@ static int bmp_decode_frame(AVCodecContext *avctx,
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(AVCodecContext *avctx,
depth = bytestream_get_le16(&buf);
- if(ihsize > 16)
+ if(ihsize == 40)
comp = bytestream_get_le32(&buf);
else
comp = BMP_RGB;