aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-10-06 22:04:48 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-10-20 21:42:20 +0200
commit4df91e2215a79546a7f08faa457c05182646b302 (patch)
tree736eec32bdb8f6d6dd5bbcafde20a491ca9c6a70
parent557aa7772e6cd646baa7bfd0046ac7e37442cff3 (diff)
downloadffmpeg-4df91e2215a79546a7f08faa457c05182646b302.tar.gz
avcodec/ffv1dec: Fail earlier if prior context is corrupted
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffv1dec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 9a610c2ff9..b1cfc4bf57 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -303,8 +303,11 @@ static int decode_slice(AVCodecContext *c, void *arg)
}
if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
return ret;
- if (f->cur->key_frame || fs->slice_reset_contexts)
+ if (f->cur->key_frame || fs->slice_reset_contexts) {
ff_ffv1_clear_slice_state(f, fs);
+ } else if (fs->slice_damaged) {
+ return AVERROR_INVALIDDATA;
+ }
width = fs->slice_width;
height = fs->slice_height;