diff options
author | Federico Tomassetti <f.tomassetti@gmail.com> | 2015-04-19 11:43:14 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-04-19 23:45:35 +0100 |
commit | 336d2f0979b43a39bd11a047d798b7990d8b07c6 (patch) | |
tree | 79e1ac07cfd5c3d0669df68a5410250ce4c92cf0 /avplay.c | |
parent | eb31256f12bf0c85aded1612551ce9230356879e (diff) | |
download | ffmpeg-336d2f0979b43a39bd11a047d798b7990d8b07c6.tar.gz |
avplay: Free frame and graph when memory allocation fails
Bug-Id: CID 1291564
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'avplay.c')
-rw-r--r-- | avplay.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1580,8 +1580,10 @@ static int video_thread(void *arg) AVFilterContext *filt_out = NULL, *filt_in = NULL; int last_w = is->video_st->codec->width; int last_h = is->video_st->codec->height; - if (!graph) + if (!graph) { + av_frame_free(&frame); return AVERROR(ENOMEM); + } if ((ret = configure_video_filters(graph, is, vfilters)) < 0) goto the_end; @@ -1589,8 +1591,12 @@ static int video_thread(void *arg) filt_out = is->out_video_filter; #endif - if (!frame) + if (!frame) { +#if CONFIG_AVFILTER + avfilter_graph_free(&graph); +#endif return AVERROR(ENOMEM); + } for (;;) { #if CONFIG_AVFILTER |