diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c index 4b2792f117..8632761cc3 100644 --- a/libavfilter/vf_signalstats.c +++ b/libavfilter/vf_signalstats.c @@ -132,8 +132,10 @@ static AVFrame *alloc_frame(enum AVPixelFormat pixfmt, int w, int h) frame->width = w; frame->height = h; - if (av_frame_get_buffer(frame, 32) < 0) + if (av_frame_get_buffer(frame, 32) < 0) { + av_frame_free(&frame); return NULL; + } return frame; }