aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libxvid.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-03-19 01:38:59 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-03-19 02:25:09 +0100
commit7f985c21744520dc38084d6badd17e4d00072e49 (patch)
tree25a50534f3443c6e9e99936ab2c03bbb0d8f855d /libavcodec/libxvid.c
parentedcbb3e1b91b53b6fcd641a7f40bd707c090e0a7 (diff)
downloadffmpeg-7f985c21744520dc38084d6badd17e4d00072e49.tar.gz
avcodec/libxvid: Fix leak of AVPacket on error
Regression since 2101b99777860c853ca2321031eb3f4047dc5894. Fixes Coverity issue #1473721. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/libxvid.c')
-rw-r--r--libavcodec/libxvid.c4
1 files changed, 3 insertions, 1 deletions
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 ) {