Browse Source

avcodec/libxvid: Fix leak of AVPacket on error

Regression since 2101b99777.
Fixes Coverity issue #1473721.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.4
Andreas Rheinhardt 4 years ago
parent
commit
7f985c2174
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/libxvid.c

+ 3
- 1
libavcodec/libxvid.c View File

@@ -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 ) {


Loading…
Cancel
Save