aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-04-02 20:01:07 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-08 19:45:46 +0200
commitc66c4da55a5e103bfb67b3009b6c51142806dfaf (patch)
tree86c7b9f701ad2ea3c0c97a0020c345629b426196
parentda51b8be0b3f02b9d717195ff129d0f85b1f567d (diff)
downloadffmpeg-c66c4da55a5e103bfb67b3009b6c51142806dfaf.tar.gz
libavcodec/rv34: error out earlier on missing references
Fixes visual corruption on seeking Fixes: downloadTest_clip_24M.rmvb Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6cd81d68c5e4b0ff00288970c4151ff4031c0ea9) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/rv34.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index c9cedfe8b2..0c4b89010e 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1579,7 +1579,7 @@ int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecConte
// Do no call ff_mpeg_update_thread_context on a partially initialized
// decoder context.
- if (!s1->linesize)
+ if (!s1->context_initialized)
return 0;
return ff_mpeg_update_thread_context(dst, src);
@@ -1727,6 +1727,8 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
if ((err = rv34_decoder_realloc(r)) < 0)
return err;
}
+ if (faulty_b)
+ return AVERROR_INVALIDDATA;
s->pict_type = si.type ? si.type : AV_PICTURE_TYPE_I;
if (ff_mpv_frame_start(s, s->avctx) < 0)
return -1;
@@ -1777,8 +1779,6 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
"multithreading mode (start MB is %d).\n", si.start);
return AVERROR_INVALIDDATA;
}
- if (faulty_b)
- return AVERROR_INVALIDDATA;
for(i = 0; i < slice_count; i++){
int offset = get_slice_offset(avctx, slices_hdr, i , slice_count, buf_size);