lavfi/showwaves: return error in case of allocation failure in filter_samples()
authorStefano Sabatini <stefasab@gmail.com>
Tue, 6 Nov 2012 21:48:54 +0000 (22:48 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Tue, 6 Nov 2012 21:48:54 +0000 (22:48 +0100)
libavfilter/avf_showwaves.c

index e526324..50a114b 100644 (file)
@@ -199,6 +199,8 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
             showwaves->outpicref = outpicref =
                 ff_get_video_buffer(outlink, AV_PERM_WRITE|AV_PERM_ALIGN,
                                     outlink->w, outlink->h);
+            if (!outpicref)
+                return AVERROR(ENOMEM);
             outpicref->video->w = outlink->w;
             outpicref->video->h = outlink->h;
             outpicref->pts = insamples->pts +