]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/src_movie: Fix leak of packet upon error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 10 Sep 2020 01:14:39 +0000 (03:14 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 10 Sep 2020 20:25:34 +0000 (22:25 +0200)
If allocating the AVFrame to contain a decoded frame fails, the AVPacket
containing the data intended to be decoded leaks. This commit fixes
this.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavfilter/src_movie.c

index 75ac3bfaf62375379f5fe53035dc6cf714941559..d83cb6d1e48986e9c7f60c6916bd9dca5deea5a0 100644 (file)
@@ -344,6 +344,7 @@ static av_cold void movie_uninit(AVFilterContext *ctx)
     }
     av_freep(&movie->st);
     av_freep(&movie->out_index);
+    av_packet_unref(&movie->pkt);
     if (movie->format_ctx)
         avformat_close_input(&movie->format_ctx);
 }