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,11 +321,13 @@ static int vaapi_encode_issue(AVCodecContext *avctx, ...@@ -321,11 +321,13 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
} }
} }
if (pic->nb_slices > 0) {
pic->slices = av_mallocz_array(pic->nb_slices, sizeof(*pic->slices)); pic->slices = av_mallocz_array(pic->nb_slices, sizeof(*pic->slices));
if (!pic->slices) { if (!pic->slices) {
err = AVERROR(ENOMEM); err = AVERROR(ENOMEM);
goto fail; goto fail;
} }
}
for (i = 0; i < pic->nb_slices; i++) { for (i = 0; i < pic->nb_slices; i++) {
slice = &pic->slices[i]; slice = &pic->slices[i];
slice->index = i; slice->index = 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