diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-05 04:12:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-05 04:12:12 +0200 |
commit | d5818c37f3219a4c6929c0401e6eacbfef3b843e (patch) | |
tree | 52054eb7730bee039a6b690088512e0526fdb436 /libavcodec | |
parent | 4216a5082bee6f5132702f5542d986ad4dcc1797 (diff) | |
parent | 810294ce3d3d9cceb3670a938379e2b2cba6cdc9 (diff) | |
download | ffmpeg-d5818c37f3219a4c6929c0401e6eacbfef3b843e.tar.gz |
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
Use os/2 palette even if it contains less than 256 entries.
Assume that old bmps do not contain transparency information.
Do not detect jp2 images as mov files.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/bmp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index 7443fa9772..458fd0c768 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -128,6 +128,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, rgb[0] = bytestream_get_le32(&buf); rgb[1] = bytestream_get_le32(&buf); rgb[2] = bytestream_get_le32(&buf); + if (ihsize > 40) alpha = bytestream_get_le32(&buf); } @@ -247,6 +248,8 @@ static int bmp_decode_frame(AVCodecContext *avctx, } else if (t) { colors = t; } + } else { + colors = FFMIN(256, (hsize-ihsize-14) / 3); } buf = buf0 + 14 + ihsize; //palette location // OS/2 bitmap, 3 bytes per palette entry |