diff mbox

[FFmpeg-devel] cavsdec: unref frame before referencing again

Message ID 17ff1b7f-21e5-f226-b675-4dbfc99b2183@googlemail.com
State Accepted
Commit 1966ea012fd72abc8003e95dc3c8ad9e9f197913
Headers show

Commit Message

Andreas Cadhalpun Oct. 20, 2016, 8:16 p.m. UTC
This fixes asserts (from commit 13aae8) in av_frame_ref and
av_frame_move_ref.

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

Comments

Michael Niedermayer Oct. 21, 2016, 12:31 a.m. UTC | #1
On Thu, Oct 20, 2016 at 10:16:17PM +0200, Andreas Cadhalpun wrote:
> This fixes asserts (from commit 13aae8) in av_frame_ref and
> av_frame_move_ref.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
> ---
>  libavcodec/cavsdec.c | 2 ++
>  1 file changed, 2 insertions(+)

should be ok

thx

[...]
Andreas Cadhalpun Oct. 21, 2016, 5:47 p.m. UTC | #2
On 21.10.2016 02:31, Michael Niedermayer wrote:
> On Thu, Oct 20, 2016 at 10:16:17PM +0200, Andreas Cadhalpun wrote:
>> This fixes asserts (from commit 13aae8) in av_frame_ref and
>> av_frame_move_ref.
>>
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>> ---
>>  libavcodec/cavsdec.c | 2 ++
>>  1 file changed, 2 insertions(+)
> 
> should be ok

Pushed.

Best regards,
Andreas
diff mbox

Patch

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 70ac6f8..fed7043 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -1217,6 +1217,8 @@  static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
                 h->got_keyframe = 1;
             }
         case PIC_PB_START_CODE:
+            if (*got_frame)
+                av_frame_unref(data);
             *got_frame = 0;
             if (!h->got_keyframe)
                 break;