You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
ffv1: Make sure at least one slice context is initialized
This avoids crashes when initializing the range coder for the first slice context. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
@@ -194,6 +194,10 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
f->slice_count = f->num_h_slices * f->num_v_slices;
|
f->slice_count = f->num_h_slices * f->num_v_slices;
|
||||||
|
if (f->slice_count <= 0) {
|
||||||
|
av_log(f->avctx, AV_LOG_ERROR, "Invalid number of slices\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < f->slice_count; i++) {
|
for (i = 0; i < f->slice_count; i++) {
|
||||||
FFV1Context *fs = av_mallocz(sizeof(*fs));
|
FFV1Context *fs = av_mallocz(sizeof(*fs));
|
||||||
|
Reference in New Issue
Block a user