Commit fe1fb48e authored by Mark Thompson's avatar Mark Thompson

Merge commit 'c8e135ea'

* commit 'c8e135ea':
  vaapi_encode: Allocate slice structures and parameter buffers dynamically

Already present as e4a6eb70, one minor
fix for libav merged.
Merged-by: 's avatarMark Thompson <sw@jkqxz.net>
parents d09368a4 c8e135ea
......@@ -321,10 +321,12 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
}
}
pic->slices = av_mallocz_array(pic->nb_slices, sizeof(*pic->slices));
if (!pic->slices) {
err = AVERROR(ENOMEM);
goto fail;
if (pic->nb_slices > 0) {
pic->slices = av_mallocz_array(pic->nb_slices, sizeof(*pic->slices));
if (!pic->slices) {
err = AVERROR(ENOMEM);
goto fail;
}
}
for (i = 0; i < pic->nb_slices; i++) {
slice = &pic->slices[i];
......
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