[FFmpeg-devel] [PATCH] avcodec/proresdec2: Do not discard frames with bad slices

Michael Niedermayer michael at niedermayer.cc
Sat Mar 4 02:30:54 EET 2017


The code previously completely discarded frames that had any error in a slice

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/proresdec2.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index a3a1ebdecb..75fba9d35d 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -618,10 +618,11 @@ static int decode_picture(AVCodecContext *avctx)
     avctx->execute2(avctx, decode_slice_thread, NULL, NULL, ctx->slice_count);
 
     for (i = 0; i < ctx->slice_count; i++)
-        if (ctx->slices[i].ret < 0)
-            return ctx->slices[i].ret;
+        if (ctx->slices[i].ret >= 0)
+            return 0;
 
-    return 0;
+    av_assert0(ctx->slice_count>0);
+    return ctx->slices[0].ret;
 }
 
 static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
-- 
2.11.0



More information about the ffmpeg-devel mailing list