From patchwork Sun Aug 13 18:38:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4700 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp3444218vsu; Sun, 13 Aug 2017 11:39:01 -0700 (PDT) X-Received: by 10.28.145.2 with SMTP id t2mr3178107wmd.179.1502649541187; Sun, 13 Aug 2017 11:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502649541; cv=none; d=google.com; s=arc-20160816; b=musebJHumnusZajbor5GfjFAAjS51ghh5i0uybbTY7697/GGHxI3cJ3ckgXm3IflT/ wK0J4CQ+eryFPS+qe0HmB937hTPDDVWUPwOk/9c8kGEqwVFv43Eke0UkhnHpJpi80FuN KHa5WG4cQuUE/IDKc+8R8kfSyJ2yuLMzbVkU4Nsx4aYT9q4byygQtC64x9NpNR+Mu2N1 GFMg4QDc+z83IQQ15OhTw03V8sIisPU0FNnm8Hjw8rms5tK8klMbhEAcmZr2m1rKB0s+ DXDk8CYX1SuT6hct2PFELkW6R9xCnLf7SreyIQK2IGgZo8XXEnnb+qrbDLGld0sETnlL 75QA== 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=5g6LWZcdN+oHLLWKZ+hzRpBntFm7Agg4kvTCIzKAB1c=; b=fBLQKeynPq05x9qbQBjz4dSzJllMqI87mGht0CVMtkSeTB3Rn8473YTLbsdjWoKqg/ vpwFsVn1d+032KlGMxwvLMqamiQvuLFcqt7xCWBaNiloJpyi2Kybyk+/IHwZzsZBu9CP 0esL1x6MFJFFNbmP1lBD7GjVJ9r6DHp++Lm2EN1eBSP2BxRCqmZEdbcfZJrcFGYH8ROp y+s+wJCzWaUBDQaVICZdxuF4kOVGcUvOustcvCIkZmgu6Y2N5KQHaQA0cnbDMUNoUCOJ +pXPsW4tkXVFSUj2x3Ew/sQ9DcQ28PV1hYwptqjtxjMldC6g72bqi+BekKStjJq3Jst5 T7UQ== 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 d80si2731518wmh.148.2017.08.13.11.39.00; Sun, 13 Aug 2017 11:39:01 -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 A0366689D06; Sun, 13 Aug 2017 21:38:53 +0300 (EEST) 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 230B46899F8 for ; Sun, 13 Aug 2017 21:38:48 +0300 (EEST) Received: from [172.31.218.52] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dgxml-0002aI-8o for ffmpeg-devel@ffmpeg.org; Sun, 13 Aug 2017 20:38:51 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dgxmf-0000SE-53 for ffmpeg-devel@ffmpeg.org; Sun, 13 Aug 2017 20:38:45 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id wieh1v0060S5wYM01ieiMR; Sun, 13 Aug 2017 20:38:42 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 13 Aug 2017 20:38:39 +0200 Message-Id: <20170813183839.18269-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170813183839.18269-1-michael@niedermayer.cc> References: <20170813183839.18269-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/cavsdec: Check P/B frame mb decode which return error codes 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/cavsdec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 02b3d213a9..06c752735e 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1090,10 +1090,12 @@ static int decode_pic(AVSContext *h) } else { mb_type = get_ue_golomb(&h->gb) + P_SKIP + h->skip_mode_flag; if (mb_type > P_8X8) - decode_mb_i(h, mb_type - P_8X8 - 1); + ret = decode_mb_i(h, mb_type - P_8X8 - 1); else decode_mb_p(h, mb_type); } + if (ret < 0) + break; } while (ff_cavs_next_mb(h)); } else { /* AV_PICTURE_TYPE_B */ do { @@ -1102,14 +1104,16 @@ static int decode_pic(AVSContext *h) if (h->skip_mode_flag && (skip_count < 0)) skip_count = get_ue_golomb(&h->gb); if (h->skip_mode_flag && skip_count--) { - decode_mb_b(h, B_SKIP); + ret = decode_mb_b(h, B_SKIP); } else { mb_type = get_ue_golomb(&h->gb) + B_SKIP + h->skip_mode_flag; if (mb_type > B_8X8) - decode_mb_i(h, mb_type - B_8X8 - 1); + ret = decode_mb_i(h, mb_type - B_8X8 - 1); else - decode_mb_b(h, mb_type); + ret = decode_mb_b(h, mb_type); } + if (ret < 0) + break; } while (ff_cavs_next_mb(h)); } emms_c();