From: Michael Niedermayer <[email protected]>

vp56dec: avoid freeing the returned frame before returning it.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <[email protected]>
Signed-off-by: Ronald S. Bultje <[email protected]>
---
 libavcodec/vp56.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index ed55763..2378832 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -621,7 +621,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, 
int *data_size,
 
     next:
         if (p->key_frame || golden_frame) {
-            if (s->framep[VP56_FRAME_GOLDEN]->data[0] &&
+            if (s->framep[VP56_FRAME_GOLDEN]->data[0] && 
s->framep[VP56_FRAME_GOLDEN] != p &&
                 s->framep[VP56_FRAME_GOLDEN] != s->framep[VP56_FRAME_GOLDEN2])
                 avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN]);
             s->framep[VP56_FRAME_GOLDEN] = p;
-- 
1.7.9.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to