From patchwork Thu Dec 15 20:21:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 1811 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp954060vsa; Thu, 15 Dec 2016 12:21:28 -0800 (PST) X-Received: by 10.28.217.195 with SMTP id q186mr119339wmg.17.1481833288184; Thu, 15 Dec 2016 12:21:28 -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 r3si3777852wjs.183.2016.12.15.12.21.27; Thu, 15 Dec 2016 12:21:28 -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 E04EE68988C; Thu, 15 Dec 2016 22:21:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-3.mx.upcmail.net (vie01a-qmta-pe01-3.mx.upcmail.net [62.179.121.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 39E14680734 for ; Thu, 15 Dec 2016 22:21:18 +0200 (EET) Received: from [172.31.218.32] (helo=vie01a-dmta-pe01-2.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cHcWq-0004HN-By for ffmpeg-devel@ffmpeg.org; Thu, 15 Dec 2016 21:21:24 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cHcWk-0001x6-Pg for ffmpeg-devel@ffmpeg.org; Thu, 15 Dec 2016 21:21:18 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id LLMH1u00s0S5wYM01LMJm1; Thu, 15 Dec 2016 21:21:18 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 15 Dec 2016 21:21:10 +0100 Message-Id: <20161215202113.20807-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161215202113.20807-1-michael@niedermayer.cc> References: <20161215202113.20807-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 4/7] avcodec/smvjpegdec: return the packet size instead of 0 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" Most decoders return the amount of data used. This is more consistent Signed-off-by: Michael Niedermayer --- libavcodec/smvjpegdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c index e319e5781b..018e135b30 100644 --- a/libavcodec/smvjpegdec.c +++ b/libavcodec/smvjpegdec.c @@ -200,9 +200,11 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz s->picture[1]->linesize[i] = mjpeg_data->linesize[i]; ret = av_frame_ref(data, s->picture[1]); + if (ret < 0) + return ret; } - return ret; + return avpkt->size; } static const AVClass smvjpegdec_class = {