Commit b65213c0 authored by Benoit Fouet's avatar Benoit Fouet

Support for BMP os2v1.

Originally committed as revision 12815 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 780169c3
...@@ -84,8 +84,16 @@ static int bmp_decode_frame(AVCodecContext *avctx, ...@@ -84,8 +84,16 @@ static int bmp_decode_frame(AVCodecContext *avctx,
return -1; return -1;
} }
if (ihsize == 40) {
width = bytestream_get_le32(&buf); width = bytestream_get_le32(&buf);
height = 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 */ if(bytestream_get_le16(&buf) != 1){ /* planes */
av_log(avctx, AV_LOG_ERROR, "invalid BMP header\n"); av_log(avctx, AV_LOG_ERROR, "invalid BMP header\n");
...@@ -94,7 +102,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, ...@@ -94,7 +102,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
depth = bytestream_get_le16(&buf); depth = bytestream_get_le16(&buf);
if(ihsize > 16) if(ihsize == 40)
comp = bytestream_get_le32(&buf); comp = bytestream_get_le32(&buf);
else else
comp = BMP_RGB; comp = BMP_RGB;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment