diff mbox

[FFmpeg-devel] mpeg12dec: unref discarded picture from extradata

Message ID 2b4bbc3d-ed29-417a-eeb6-131b826a6881@googlemail.com
State Accepted
Commit a92f8edf0c51781e152651cce2e753ad6e359eb2
Headers show

Commit Message

Andreas Cadhalpun Oct. 20, 2016, 8:57 p.m. UTC
Otherwise another frame gets referenced into picture, triggering an assert
(from commit 13aae8) in av_frame_ref.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 libavcodec/mpeg12dec.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer Oct. 21, 2016, 12:36 a.m. UTC | #1
On Thu, Oct 20, 2016 at 10:57:15PM +0200, Andreas Cadhalpun wrote:
> Otherwise another frame gets referenced into picture, triggering an assert
> (from commit 13aae8) in av_frame_ref.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
> ---
>  libavcodec/mpeg12dec.c | 1 +
>  1 file changed, 1 insertion(+)

should be ok

thx

[...]
Andreas Cadhalpun Oct. 21, 2016, 5:47 p.m. UTC | #2
On 21.10.2016 02:36, Michael Niedermayer wrote:
> On Thu, Oct 20, 2016 at 10:57:15PM +0200, Andreas Cadhalpun wrote:
>> Otherwise another frame gets referenced into picture, triggering an assert
>> (from commit 13aae8) in av_frame_ref.
>>
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>> ---
>>  libavcodec/mpeg12dec.c | 1 +
>>  1 file changed, 1 insertion(+)
> 
> should be ok

Pushed.

Best regards,
Andreas
diff mbox

Patch

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 44f7b61..ac8160d 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2808,6 +2808,7 @@  static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
                             avctx->extradata, avctx->extradata_size);
         if (*got_output) {
             av_log(avctx, AV_LOG_ERROR, "picture in extradata\n");
+            av_frame_unref(picture);
             *got_output = 0;
         }
         s->extradata_decoded = 1;