[2/9] avcodec/extract_extradata_bsf: Fix leak discovered via fuzzing

Message ID 20181003191538.33448-3-lu_zero@gentoo.org
State Committed
Commit aaf7fd168050212c1a9b9c2080805c5095e86d20
Headers show
Series
  • [1/9] avcodec/bsf: Add ff_bsf_get_packet_ref() function
Related show

Commit Message

Luca Barbato Oct. 3, 2018, 7:15 p.m.
From: Nikolas Bowe <nbowe-at-google.com@ffmpeg.org>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
---
 libavcodec/extract_extradata_bsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c
index 100c60d063..10d108054a 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -78,7 +78,7 @@  static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
     ret = ff_h2645_packet_split(&h2645_pkt, pkt->data, pkt->size,
                                 ctx, 0, 0, ctx->par_in->codec_id);
     if (ret < 0)
-        return ret;
+        goto fail;
 
     for (i = 0; i < h2645_pkt.nb_nals; i++) {
         H2645NAL *nal = &h2645_pkt.nals[i];