[FFmpeg-devel] [PATCH] vp9: check return value of ff_thread_ref_frame().

Ronald S. Bultje rsbultje at gmail.com
Sat Sep 5 02:11:05 CEST 2015


Fixes CID 1322309.
---
 libavcodec/vp9.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 7624743..25e7419 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -4250,7 +4250,9 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
     for (i = 0; i < 8; i++) {
         if (s->refs[i].f->data[0])
             ff_thread_release_buffer(ctx, &s->refs[i]);
-        ff_thread_ref_frame(&s->refs[i], &s->next_refs[i]);
+        if (s->next_refs[i].f->data[0] &&
+            (res = ff_thread_ref_frame(&s->refs[i], &s->next_refs[i])) < 0)
+            return res;
     }
 
     if (!s->invisible) {
-- 
2.1.2



More information about the ffmpeg-devel mailing list