From patchwork Tue Apr 17 00:13:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 8467 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.1.85 with SMTP id c82csp1374955jad; Mon, 16 Apr 2018 17:15:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Ju1ATT9y6MZI/sscqO6vsRsRehD/zk7qo2ksOf+CwBYCL3BfiI6SbEVNaQcz4C1bJgw4n X-Received: by 10.223.219.144 with SMTP id u16mr5069213wri.90.1523924105927; Mon, 16 Apr 2018 17:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523924105; cv=none; d=google.com; s=arc-20160816; b=J4eCfqz25OQuoWSmPiYKAs8u/tWtO/eoCAAfYHqlzVmbCKsMERWNPf5/bc+tySzKSE XPdebdZv2y53JmajKwU1lUkfyXJ08c9YXby4algW8zw4BR4M/p/DQvlLtpUj54JjAuJH hZU0kkuN5nlVYv9AoFafvIJ5m9o26vvWHNBWxpJIMva5U/Tvqwet2XKx0cYXmhnu082r qAtbfjktveuIgdlKzrsJFP+pGCh8dY3CnRVjdo2Xe/ZToxn4xW9dIYLRkIp1nXbJvWOd 2FceG2BNf64rf5N5qFInNDRTtGbTs8nvlw5AK2Y6oTuqMBRsLj7bnR9ipJcNyDap65TA 2q4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=Q5O3gNZw4JnMj2fXpJiyH9cMamNLhHkwb2vHZjJI5P0=; b=lv23KlgwEkUKjLdoC2UmUhpCSdSjV5m8C/S9dciC4YVJ/eziOm6AAQ/MqAcvTvnuKL wIOASg/hvNDrhKGuFXRAS+nbFtbd8fbociYi2Ar54BnuUfLSqIQ2FdNyITLX5ubFYThh bgW1Gx51SGlELStNpcsVWCoKMFbBj+EuJ2BEJXhPv733+SQBeuN2Gk3wRVUQEUZ/73Sd ARvV2AyDmJPvWf+7WCAUsPJOitV7YwhPZKFQ0IJnA61dFSaT2TE3TetGqnDpQsN7P90f ozDh3o7v5X0NAgs5Zoqgwt2Ud3/xBVq4zM0XO8scYNcfdzUXHkpUeI/Xe1yxtYdv7FI9 /U9Q== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 202si5867148wmt.166.2018.04.16.17.15.05; Mon, 16 Apr 2018 17:15:05 -0700 (PDT) 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 BD845689E42; Tue, 17 Apr 2018 03:14:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe07-1.mx.upcmail.net (vie01a-dmta-pe07-1.mx.upcmail.net [84.116.36.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EABB6680C92 for ; Tue, 17 Apr 2018 03:14:22 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1f8EGn-0002ij-Bp for ffmpeg-devel@ffmpeg.org; Tue, 17 Apr 2018 02:14:49 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id bCEk1x00P0S5wYM01CElMp; Tue, 17 Apr 2018 02:14:45 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 17 Apr 2018 02:13:45 +0200 Message-Id: <20180417001346.8174-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417001346.8174-1-michael@niedermayer.cc> References: <20180417001346.8174-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/dsicinvideo: Propagate errors from cin_decode_rle() 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" Signed-off-by: Michael Niedermayer --- libavcodec/dsicinvideo.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libavcodec/dsicinvideo.c b/libavcodec/dsicinvideo.c index f95cbc74a0..add7afa383 100644 --- a/libavcodec/dsicinvideo.c +++ b/libavcodec/dsicinvideo.c @@ -226,27 +226,35 @@ static int cinvideo_decode_frame(AVCodecContext *avctx, * surface.width = surface.pitch */ switch (bitmap_frame_type) { case 9: - cin_decode_rle(buf, bitmap_frame_size, + res = cin_decode_rle(buf, bitmap_frame_size, cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size); + if (res < 0) + return res; break; case 34: - cin_decode_rle(buf, bitmap_frame_size, + res = cin_decode_rle(buf, bitmap_frame_size, cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size); + if (res < 0) + return res; cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP], cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size); break; case 35: bitmap_frame_size = cin_decode_huffman(buf, bitmap_frame_size, cin->bitmap_table[CIN_INT_BMP], cin->bitmap_size); - cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size, + res = cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size, cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size); + if (res < 0) + return res; break; case 36: bitmap_frame_size = cin_decode_huffman(buf, bitmap_frame_size, cin->bitmap_table[CIN_INT_BMP], cin->bitmap_size); - cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size, + res = cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size, cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size); + if (res < 0) + return res; cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP], cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size); break;