From patchwork Sun Aug 6 12:38:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4636 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp1687358vsu; Sun, 6 Aug 2017 05:38:49 -0700 (PDT) X-Received: by 10.28.132.3 with SMTP id g3mr4848924wmd.4.1502023129292; Sun, 06 Aug 2017 05:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502023129; cv=none; d=google.com; s=arc-20160816; b=v1hHYG3kCwkzlGFvDU9fWkanMgppuhSFulrYw6zyjPpW175/S0h0FvUCGZk+f/3t09 78UxJQHefbvuN2sPiwjDpMqDZwVE1shX35ovRYBF3ppblfjed9knIAqcYU9Fws4wnxnx mT60cYtIkR4SNgNeFHOC05MI11FDlKGme+MAX+JVgjCRlvsZhHVJVMsG56AHOg9ERgHG 9GT1QpSK+0d7DTG9d8UUTJfUHIcu0E3TP/mxYBqEWr4hVM2lp79C3TpUAWRNpucPqsMC QdjkN165/XeNmiMSUJg7Q0RalUSJBr/VilEBg10my0GpTigS4++Nan6W3EKlDINlWlse FkYQ== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ppq+FhnHwKj3gDLXau+DtEP+L5bfGFdESIZhjJUEYqw=; b=jQenXRw4PXAHv/AhM0fqtgOm+1dLnC6P6PFHCGbHSCFiJKK0V60wQsuhWPeZzwryd5 1odnMblFClMqozq05AyOrveP8tNmSXIisY+z1Em/K2eQfa4tq91YeK75LFWEGNU/0ivq wWC5m0hL7SyafpiMWarUBIvoHBru/YiBfuGkEiwNWaDunoqv8mFCxs09/tf5wfd2EfaF nv9gy/D+punlVzptKYy0sqLHVrsb+drIjmQNMQ8rZrUQNMzeZeOGq0VtbLC4FBfA+VnE pO9zbW/E9EDOWv47vL0Gkyh15V0mK4VLs+yWhsKDC9mwu1VcAmfHOuwZSPzYWZti9Lpi lkIQ== 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 t98si6812481wrc.299.2017.08.06.05.38.48; Sun, 06 Aug 2017 05:38:49 -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 423EF6883E1; Sun, 6 Aug 2017 15:38:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-1.mx.upcmail.net (vie01a-qmta-pe01-1.mx.upcmail.net [62.179.121.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 32E90688253 for ; Sun, 6 Aug 2017 15:38:39 +0300 (EEST) Received: from [172.31.218.46] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1deKpL-0006Jw-Pc for ffmpeg-devel@ffmpeg.org; Sun, 06 Aug 2017 14:38:39 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1deKpG-000539-1o for ffmpeg-devel@ffmpeg.org; Sun, 06 Aug 2017 14:38:34 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id toeV1v01x0S5wYM01oeW9J; Sun, 06 Aug 2017 14:38:31 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 6 Aug 2017 14:38:29 +0200 Message-Id: <20170806123829.18433-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avcodec/mpeg4videodec: Clear mcsel before decoding an image 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" Fixes: runtime error: signed integer overflow: 2146467840 + 1032192 cannot be represented in type 'int' Fixes: 2826/clusterfuzz-testcase-minimized-5901511613743104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/mpeg4videodec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 89c4b367f7..8f85e9362d 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2290,6 +2290,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) int time_incr, time_increment; int64_t pts; + s->mcsel = 0; s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I; /* pict type: I = 0 , P = 1 */ if (s->pict_type == AV_PICTURE_TYPE_B && s->low_delay && ctx->vol_control_parameters == 0 && !(s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY)) {