mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-21 22:36:59 +00:00
avcodec/magicyuvenc: ensure no slice slot is left unset
This commit is contained in:
parent
67cc7aaa51
commit
f832a77231
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user