[FFmpeg-cvslog] Merge commit 'c8e135ea9225137050a6315fd9ba9c0f242c90b6'

Mark Thompson git at videolan.org
Wed Feb 21 23:47:34 EET 2018


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Wed Feb 21 21:46:09 2018 +0000| [fe1fb48e2bd1e5bddcde8b898084851cc8f6939c] | committer: Mark Thompson

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 at jkqxz.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fe1fb48e2bd1e5bddcde8b898084851cc8f6939c
---

 libavcodec/vaapi_encode.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 550ea47991..f552071802 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -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];


======================================================================




More information about the ffmpeg-cvslog mailing list