]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/f_ebur128: check if frame clone is set
authorPaul B Mahol <onemda@gmail.com>
Tue, 14 Jan 2020 15:43:45 +0000 (16:43 +0100)
committerPaul B Mahol <onemda@gmail.com>
Tue, 14 Jan 2020 15:52:08 +0000 (16:52 +0100)
libavfilter/f_ebur128.c

index f25d5f096e50de42a066d84e45ec9c1008ef1c1a..31b75ab097effda9de8d3a09ae1c342e68d57b82 100644 (file)
@@ -774,6 +774,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
 
             /* push one video frame */
             if (ebur128->do_video) {
+                AVFrame *clone;
                 int x, y, ret;
                 uint8_t *p;
                 double gauge_value;
@@ -823,7 +824,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
 
                 /* set pts and push frame */
                 pic->pts = pts;
-                ret = ff_filter_frame(outlink, av_frame_clone(pic));
+                clone = av_frame_clone(pic);
+                if (!clone)
+                    return AVERROR(ENOMEM);
+                ret = ff_filter_frame(outlink, clone);
                 if (ret < 0)
                     return ret;
             }