lavfi/anullsrc: add missing checks
authorStefano Sabatini <stefasab@gmail.com>
Fri, 22 Mar 2013 00:43:43 +0000 (01:43 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Sat, 23 Mar 2013 15:53:25 +0000 (16:53 +0100)
libavfilter/asrc_anullsrc.c

index 062aefc..84260c3 100644 (file)
@@ -114,12 +114,17 @@ static int request_frame(AVFilterLink *outlink)
     AVFrame *samplesref;
 
     samplesref = ff_get_audio_buffer(outlink, null->nb_samples);
+    if (!samplesref)
+        return AVERROR(ENOMEM);
+
     samplesref->pts = null->pts;
     samplesref->channel_layout = null->channel_layout;
     samplesref->sample_rate = outlink->sample_rate;
 
     ret = ff_filter_frame(outlink, av_frame_clone(samplesref));
     av_frame_free(&samplesref);
+    if (ret < 0)
+        return ret;
 
     null->pts += null->nb_samples;
     return ret;