Browse Source

Merge commit 'c8e135ea9225137050a6315fd9ba9c0f242c90b6'

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

Already present as e4a6eb70f471eda36592078e8fa1bad87fc9df73, one minor
fix for libav merged.

Merged-by: Mark Thompson <sw@jkqxz.net>
tags/n4.0
Mark Thompson 7 years ago
parent
commit
fe1fb48e2b
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      libavcodec/vaapi_encode.c

+ 6
- 4
libavcodec/vaapi_encode.c View File

@@ -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];


Loading…
Cancel
Save