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>
This commit is contained in:
parent
835d9f299c
commit
8aa4f3bb4f
@ -614,14 +614,19 @@ static int decode_picture(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
ProresContext *ctx = avctx->priv_data;
|
ProresContext *ctx = avctx->priv_data;
|
||||||
int i;
|
int i;
|
||||||
|
int error = 0;
|
||||||
|
|
||||||
avctx->execute2(avctx, decode_slice_thread, NULL, NULL, ctx->slice_count);
|
avctx->execute2(avctx, decode_slice_thread, NULL, NULL, ctx->slice_count);
|
||||||
|
|
||||||
for (i = 0; i < ctx->slice_count; i++)
|
for (i = 0; i < ctx->slice_count; i++)
|
||||||
if (ctx->slices[i].ret < 0)
|
error += ctx->slices[i].ret < 0;
|
||||||
return ctx->slices[i].ret;
|
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
av_frame_set_decode_error_flags(ctx->frame, FF_DECODE_ERROR_INVALID_BITSTREAM);
|
||||||
|
if (error < ctx->slice_count)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
return ctx->slices[0].ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user