From patchwork Sat Mar 4 00:30:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 2750 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.31.14 with SMTP id f14csp481600vsf; Fri, 3 Mar 2017 16:31:12 -0800 (PST) X-Received: by 10.223.165.138 with SMTP id g10mr5074195wrc.105.1488587472390; Fri, 03 Mar 2017 16:31:12 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m80si4806468wmi.31.2017.03.03.16.31.11; Fri, 03 Mar 2017 16:31:12 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 37269688285; Sat, 4 Mar 2017 02:30:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-1.mx.upcmail.net (vie01a-dmta-pe03-1.mx.upcmail.net [62.179.121.160]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 750F0680774 for ; Sat, 4 Mar 2017 02:30:50 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cjxbB-0003sl-8s for ffmpeg-devel@ffmpeg.org; Sat, 04 Mar 2017 01:31:01 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id rcWu1u00r0S5wYM01cWvXK; Sat, 04 Mar 2017 01:30:56 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 4 Mar 2017 01:30:54 +0100 Message-Id: <20170304003054.17741-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] avcodec/proresdec2: Do not discard frames with bad slices X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The code previously completely discarded frames that had any error in a slice Signed-off-by: Michael Niedermayer --- 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,