From d9010daa6ffc053a41f702dd4c3483eb745355a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <Reimar.Doeffinger@gmx.de>
Date: Sat, 5 Nov 2011 23:27:00 +0100
Subject: [PATCH] Set AVFrame reference before reget_buffer.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Otherwise it might return a write-only frame which would break
decoding completely.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
---
 libavcodec/roqvideodec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index f0c3ebb8d9b..161e7da08a4 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -189,6 +189,7 @@ static int roq_decode_frame(AVCodecContext *avctx,
     RoqContext *s = avctx->priv_data;
     int copy= !s->current_frame->data[0];
 
+    s->current_frame->reference = 3;
     if (avctx->reget_buffer(avctx, s->current_frame)) {
         av_log(avctx, AV_LOG_ERROR, "  RoQ: get_buffer() failed\n");
         return -1;
-- 
GitLab