Commit f832a772 authored by Paul B Mahol's avatar Paul B Mahol

avcodec/magicyuvenc: ensure no slice slot is left unset

parent 67cc7aaa
......@@ -209,6 +209,7 @@ static av_cold int magy_encode_init(AVCodecContext *avctx)
s->nb_slices = FFMIN(s->nb_slices, avctx->height >> s->vshift[1]);
s->nb_slices = FFMAX(1, s->nb_slices);
s->slice_height = FFALIGN((avctx->height + s->nb_slices - 1) / s->nb_slices, 1 << s->vshift[1]);
s->nb_slices = (avctx->height + s->slice_height - 1) / s->slice_height;
s->slice_pos = av_calloc(s->nb_slices * s->planes, sizeof(*s->slice_pos));
s->slice_size = av_calloc(s->nb_slices * s->planes, sizeof(*s->slice_size));
s->slices = av_calloc(s->nb_slices * s->planes, sizeof(*s->slices));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment