From patchwork Sun Dec 18 17:08:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 39724 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp3343198pzb; Sun, 18 Dec 2022 09:09:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf4z3naV8oq84yanSQXFP3KmFxT0DLcMspcY3dFmVY4QfMjj91Q1GoqKMR9cSUBfbt0ovHM7 X-Received: by 2002:a17:906:4ad1:b0:7c0:d0ba:e81f with SMTP id u17-20020a1709064ad100b007c0d0bae81fmr35170357ejt.1.1671383342548; Sun, 18 Dec 2022 09:09:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671383342; cv=none; d=google.com; s=arc-20160816; b=kBTg4MrfGHkNAwC/okcOZEXdCtTlcwvz+2pzdyKgR/+OcwRU3kS4SazAqYEFTI/Gcd xShItFOre9tcTOTyp1KSaroM1qjz4YaIhoV1SAz/nNF4J6zpmjGwtZkhQ5qpHj/0/vhv VJkXAAwT5qkwpgxeXEi4C1RCqTn/TMKCzz60tHxi7rHlNPcX1jj+3RowAMKHmsDaVwGk lHyjA6l0VgNZawtGrpXTStoXnPXOVC0Uz2lTFtiquXZMCaHXp0YEq8AXif7O1fwF7k18 a/5nw54xps9XIrPUk3hwL3ZtYniWI/fcmPlZuP1zfCvhA75Z89ys5Ukms30jQ1tJbRWL e5cw== 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; bh=F90qHbH7XCuSefAsxKROo2AGJAV93r2QIpVSNOsosGU=; b=MWjz2vIU0D/lJBXKPARr0L2kUVyG4gXdwH0Qj87h1goE34cOzFinP5fufWuR0A+eu0 KBcnm3UbkRcOZCRZxfbkJlmBYa09pLjKGqQhrQfm6ADEUapnAYLYfgYMdILyKjwnsW1u /yw5qNaZ2n1Ieo3pXJlu/6EL3/2+TmopIbL32Th+PIiqbibLcWFOhOt2Y5zIn/xhxZAa G4KRJwnwUQJG13gwsu/ciUzCApLBdqQJpWg1dauPPjIOhbFh1f7bRz/2y3ft26k1NF87 Q0A4mIzY0J7Kb2pXUtpgOe43a6gvKFn3muJFPOol0g0dOCwOIGz1xiisW873D5UXMgbR 4gww== 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 qa17-20020a170907869100b007d6105e0acfsi7280254ejc.501.2022.12.18.09.09.02; Sun, 18 Dec 2022 09:09:02 -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 B650068B7D5; Sun, 18 Dec 2022 19:08:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D2C4668B3EA for ; Sun, 18 Dec 2022 19:08:35 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id D9ACA20004 for ; Sun, 18 Dec 2022 17:08:34 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 18 Dec 2022 18:08:22 +0100 Message-Id: <20221218170823.32130-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221218170823.32130-1-michael@niedermayer.cc> References: <20221218170823.32130-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/h264_slice: Use unsigned for fgs seed computation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: nFI+vJDXW3Xm Fixes: signed integer overflow: 2147481600 + 13408 cannot be represented in type 'int' Fixes: 53963/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4650467311616000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/h264_slice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 420758ba0a..6188c74632 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1228,7 +1228,7 @@ static int h264_export_frame_props(H264Context *h) ret = ff_h2645_sei_to_frame(out, &h->sei.common, AV_CODEC_ID_H264, h->avctx, &sps->vui, sps->bit_depth_luma, sps->bit_depth_chroma, - cur->poc + (h->poc_offset << 5)); + cur->poc + (unsigned)(h->poc_offset << 5)); if (ret < 0) return ret;