From patchwork Sun Mar 5 23:36:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 40588 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d046:b0:cd:afd7:272c with SMTP id hv6csp2478120pzb; Sun, 5 Mar 2023 15:37:09 -0800 (PST) X-Google-Smtp-Source: AK7set8N+hJo0Rsme+EZNd+RFSN81GG63hcayGLJIBMfZKDrBkAO4BNwqWPsqO/E0pPq/jPOooh/ X-Received: by 2002:a17:907:6e0f:b0:907:672b:736a with SMTP id sd15-20020a1709076e0f00b00907672b736amr10476000ejc.31.1678059428811; Sun, 05 Mar 2023 15:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678059428; cv=none; d=google.com; s=arc-20160816; b=p+jUEWS8vYBpifazU7ExaiHY4lK+XYkM2IF3sDNkxrpbgHQgkPPiLEgXmuaN3hdypA W0nVkMNDrFdzyfy8urdrdFyhpFH8rBV6ipm06dolWSr8F22RBGlwYBgZcRKI3b4AoGdV 4I53YRuciP1e2xGEUjd8Hy7cBzjoR5XTEqG2R0nx73Zyh/o8BQJ03Hj7nh3rJpC+ARGN zXe+p43R96DPhJUspKnBSEntXHXZdUSPEqZlo6gf0Ti0GamPYqgX8E/NIA8tBRhogABs LWEYa469Hn7N2s5iOfyVHU4kg//WOKSyMgUV9bg+bu6kg/EaCyU+nI2LcFN3ZOrB9eTK YpRg== 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; bh=Y/mwPgIETTkY9GYa+IsxDJIG/8yBKMHMboXEg9/8uGE=; b=FzqLJhJZko3sJX7LtnG/FjkG22IEdaC1+eTBhg5WwjEo0sbEC0Rj7ZkHys8TQyjdZm xmoix1+0LnvNNerIDFuYvXBnA1x0qAuWoMyRODaREVcHQcGn3bb8eVK8Efd2ZgUuCRlD EcxppPieKq01mQrC3pjULTGJQ3L09bSrDUxyMqZb42rBVypnEsQ99DVwnCOnD7h2HuBx ynsNmEv2uKVsNI7NuF1f684XjBlZfeLqw8gma4K6qvOe84sUn/z1/nf2dcYjK8hPxUUj g8gnpDgLdfvzfjieWkt/fd8x0heqDoP7HlU4CzrCWcLwQzSbHeNSCUY5ou5vXz5IPcEn 032Q== 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 f22-20020a170906c09600b008bb405ac759si5675378ejz.817.2023.03.05.15.37.07; Sun, 05 Mar 2023 15:37:08 -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 7FB3068B1C7; Mon, 6 Mar 2023 01:37:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 88F9968A829 for ; Mon, 6 Mar 2023 01:36:56 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 55C441C0003 for ; Sun, 5 Mar 2023 23:36:55 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 6 Mar 2023 00:36:52 +0100 Message-Id: <20230305233654.13895-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/escape124: fix signdness of end of input check 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: jDk8HSJcO3DL Fixes: Timeout Fixes: 56561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-5560363635834880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/escape124.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index 024eec59ce..e9c6b2df1b 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -89,7 +89,7 @@ static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth, unsigned i, j; CodeBook cb = { 0 }; - if (size >= INT_MAX / 34 || get_bits_left(gb) < size * 34) + if (size >= INT_MAX / 34 || get_bits_left(gb) < (int)size * 34) return cb; if (size >= INT_MAX / sizeof(MacroBlock))