summaryrefslogtreecommitdiff
path: root/libavcodec/proresdec2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-04 01:30:54 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-03-06 16:47:17 +0100
commit8aa4f3bb4f772404ff43a3c8c9d5faaadafbdfdd (patch)
treec24c4f8ce60c1f18743d91ae6d1eca2dc504eeb9 /libavcodec/proresdec2.c
parent835d9f299cf6b3704989a7b3eccfa1c2ec6866d9 (diff)
avcodec/proresdec2: Do not discard frames with bad slices
The code previously completely discarded frames that had any error in a slice Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/proresdec2.c')
-rw-r--r--libavcodec/proresdec2.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index a3a1ebdecb..ff46bcfde0 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -614,14 +614,19 @@ static int decode_picture(AVCodecContext *avctx)
{
ProresContext *ctx = avctx->priv_data;
int i;
+ int error = 0;
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;
+ error += ctx->slices[i].ret < 0;
- return 0;
+ if (error)
+ av_frame_set_decode_error_flags(ctx->frame, FF_DECODE_ERROR_INVALID_BITSTREAM);
+ if (error < ctx->slice_count)
+ return 0;
+
+ return ctx->slices[0].ret;
}
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,