diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2010-02-23 07:07:54 +0000 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2010-02-23 07:07:54 +0000 |
commit | 4f974de6f6282d6ecfe4c976d07ee20b782d0be8 (patch) | |
tree | 484c1d4b55da25c0c2aa01ca23143a521ed7bc7f | |
parent | bf0d54a381f8c53fdf756bd477bf3b7f6acb7f71 (diff) | |
download | ffmpeg-4f974de6f6282d6ecfe4c976d07ee20b782d0be8.tar.gz |
Decode alpha plane in Bink video
Originally committed as revision 21982 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/bink.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c index 1d59ea3118..a4342faad4 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -911,12 +911,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac init_get_bits(&gb, pkt->data, bits_count); if (c->has_alpha) { - int aplane_bits = get_bits_long(&gb, 32) << 3; - if (aplane_bits <= 32 || (aplane_bits & 0x1F)) { - av_log(avctx, AV_LOG_ERROR, "Incorrect alpha plane size %d\n", aplane_bits); + if (c->version >= 'i') + skip_bits_long(&gb, 32); + if (bink_decode_plane(c, &gb, 3, 0) < 0) return -1; - } - skip_bits_long(&gb, aplane_bits - 32); } if (c->version >= 'i') skip_bits_long(&gb, 32); @@ -977,7 +975,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return 1; } - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = c->has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P; avctx->idct_algo = FF_IDCT_BINK; dsputil_init(&c->dsp, avctx); |