avcodec/mp3_header_decompress: don't free the user provided packet on error
authorJames Almer <jamrial@gmail.com>
Mon, 19 Mar 2018 03:21:19 +0000 (00:21 -0300)
committerJames Almer <jamrial@gmail.com>
Wed, 28 Mar 2018 04:17:51 +0000 (01:17 -0300)
It's owned by the caller.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit f18f9734694ea0761f94d57685f342b690d563b0)

libavcodec/mp3_header_decompress_bsf.c

index 22c1ef0..2948589 100644 (file)
@@ -87,7 +87,7 @@ static int mp3_header_decompress(AVBSFContext *ctx, AVPacket *out)
         goto fail;
     ret = av_packet_copy_props(out, in);
     if (ret < 0) {
-        av_packet_free(&out);
+        av_packet_unref(out);
         goto fail;
     }
     memcpy(out->data + frame_size - buf_size, buf, buf_size + AV_INPUT_BUFFER_PADDING_SIZE);