[FFmpeg-cvslog] avcodec/libxvid: Fix leak of AVPacket on error
Andreas Rheinhardt
git at videolan.org
Fri Mar 19 03:28:18 EET 2021
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Fri Mar 19 01:38:59 2021 +0100| [7f985c21744520dc38084d6badd17e4d00072e49] | committer: Andreas Rheinhardt
avcodec/libxvid: Fix leak of AVPacket on error
Regression since 2101b99777860c853ca2321031eb3f4047dc5894.
Fixes Coverity issue #1473721.
Reviewed-by: James Almer <jamrial at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f985c21744520dc38084d6badd17e4d00072e49
---
libavcodec/libxvid.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 7dc6859571..25b0025d5f 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -692,8 +692,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
return AVERROR(ENOMEM);
picture = av_frame_alloc();
- if (!picture)
+ if (!picture) {
+ av_packet_free(&packet);
return AVERROR(ENOMEM);
+ }
xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL);
if( xerr ) {
More information about the ffmpeg-cvslog
mailing list