summaryrefslogtreecommitdiffstats
path: root/libavcodec/dvdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-25 00:18:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-25 00:27:38 +0200
commitdee551bbd280c5f43b9f100d944944c27f188549 (patch)
tree9f505b6cd0d0f7b2edb36b2cc8d9cd269b896fc9 /libavcodec/dvdec.c
parente21b090bfb7b6b723ff1c28cc5bb16e7498addb2 (diff)
downloadffmpeg-streaming-dee551bbd280c5f43b9f100d944944c27f188549.zip
ffmpeg-streaming-dee551bbd280c5f43b9f100d944944c27f188549.tar.gz
avcodec/dvdec: skip 3rd stage ac decoding when the headers indicates that the data is inconsistent
Fixes Ticket1589 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dvdec.c')
-rw-r--r--libavcodec/dvdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 656110e..2a241ab 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -294,6 +294,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
int vs_bit_buffer_damaged = 0;
int mb_bit_buffer_damaged[5] = {0};
int retried = 0;
+ int sta;
av_assert1((((int) mb_bit_buffer) & 7) == 0);
av_assert1((((int) vs_bit_buffer) & 7) == 0);
@@ -310,6 +311,12 @@ retry:
for (mb_index = 0; mb_index < 5; mb_index++, mb1 += s->sys->bpm, block1 += s->sys->bpm * 64) {
/* skip header */
quant = buf_ptr[3] & 0x0f;
+ if ((buf_ptr[3] >> 4) == 0x0E)
+ vs_bit_buffer_damaged = 1;
+ if (!mb_index) {
+ sta = buf_ptr[3] >> 4;
+ } else if (sta != (buf_ptr[3] >> 4))
+ vs_bit_buffer_damaged = 1;
buf_ptr += 4;
init_put_bits(&pb, mb_bit_buffer, 80);
mb = mb1;
OpenPOWER on IntegriCloud