diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-06 22:04:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-05-26 00:04:29 +0200 |
commit | 03758674e2657a61c0931df2c785f71a03712b49 (patch) | |
tree | 1b622c0c5cd99c70e4aa92582ecf0eca7f225a51 | |
parent | d12e316dbd0375f3269a6ba8f3a09a11e6f65bd7 (diff) | |
download | ffmpeg-03758674e2657a61c0931df2c785f71a03712b49.tar.gz |
avcodec/ffv1dec: Fail earlier if prior context is corrupted
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4df91e2215a79546a7f08faa457c05182646b302)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/ffv1dec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index dddfaed4d5..5700b1b4de 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -304,8 +304,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; |