1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avcodec/ffv1dec: Fail earlier if prior context is corrupted

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4df91e2215)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2022-10-06 22:04:48 +02:00
parent 3f28c576e0
commit a16aaae628
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -301,8 +301,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;