From patchwork Tue Feb 28 21:07:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 2705 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.149 with SMTP id x21csp1629872vsf; Tue, 28 Feb 2017 13:08:19 -0800 (PST) X-Received: by 10.28.146.207 with SMTP id u198mr472673wmd.36.1488316099008; Tue, 28 Feb 2017 13:08:19 -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 h15si3876601wrb.227.2017.02.28.13.08.18; Tue, 28 Feb 2017 13:08:18 -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 271116891F2; Tue, 28 Feb 2017 23:08:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-3.mx.upcmail.net (vie01a-dmta-pe02-3.mx.upcmail.net [62.179.121.159]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C8C5688375 for ; Tue, 28 Feb 2017 23:08:00 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cip0F-0003qG-0H for ffmpeg-devel@ffmpeg.org; Tue, 28 Feb 2017 22:08:11 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id qM7g1u01B0S5wYM01M7hxK; Tue, 28 Feb 2017 22:07:41 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 28 Feb 2017 22:07:37 +0100 Message-Id: <20170228210738.19786-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170228210738.19786-1-michael@niedermayer.cc> References: <20170228210738.19786-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/ituh263dec: Use 0xffff as error code in h263p_decode_umotion() 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" This matches ff_h263_decode_motion() both functions error codes are interpreted by the same common code Fixes: 690/clusterfuzz-testcase-4744944981901312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/ituh263dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index e39338870f..edb68861ac 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -305,7 +305,7 @@ static int h263p_decode_umotion(MpegEncContext * s, int pred) code += get_bits1(&s->gb); if (code >= 32768) { avpriv_request_sample(s->avctx, "Huge DMV"); - return AVERROR_INVALIDDATA; + return 0xffff; } } sign = code & 1;