]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/af_asetnsamples: do not leak frame on ENOMEM
authorMarton Balint <cus@passwd.hu>
Sun, 7 Oct 2018 20:47:19 +0000 (22:47 +0200)
committerMarton Balint <cus@passwd.hu>
Tue, 9 Oct 2018 19:46:28 +0000 (21:46 +0200)
Fixes Coverity CID 1416352.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavfilter/af_asetnsamples.c

index 30fabede2643acca20ffa3c3c432e517b4cbd77d..e8daec8d8f9a3f33c242b2a62a6367bcc950d36d 100644 (file)
@@ -71,8 +71,10 @@ static int activate(AVFilterContext *ctx)
             return ff_filter_frame(outlink, frame);
 
         pad_frame = ff_get_audio_buffer(outlink, s->nb_out_samples);
-        if (!pad_frame)
+        if (!pad_frame) {
+            av_frame_free(&frame);
             return AVERROR(ENOMEM);
+        }
 
         av_samples_copy(pad_frame->extended_data, frame->extended_data,
                         0, 0, frame->nb_samples, frame->channels, frame->format);