From patchwork Wed Jul 17 11:27:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 50611 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:40f5:b0:482:c625:d099 with SMTP id lb53csp856214vqb; Wed, 17 Jul 2024 04:28:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVYNScKNskHQqrFPwG2H4RcaTR4v38UO/NBus8RKAJtb/h5WgS4/qCULjSYQAsOiVwf55JS0CCDh3/xsBvA+A6axF7uWbLmGEmtGA== X-Google-Smtp-Source: AGHT+IGAbNtzylDYZotQsKkbrN16gV2m6IwdAhSS2pvAlVaOVNUUDVZqs9i/PcqWA8a+Ut0zgVXh X-Received: by 2002:a2e:9bd0:0:b0:2ec:558d:4e0a with SMTP id 38308e7fff4ca-2eefd0b4575mr13195941fa.19.1721215679805; Wed, 17 Jul 2024 04:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721215679; cv=none; d=google.com; s=arc-20160816; b=ImqJ6rTO4YyzBW9mT6CHhryxz1BD2nNPeXy+nzaS8NFkXwmFI3pAZv0UiBVfdpdATA y0EQu+ypZb9rbPDwzLI6jYtP/TsDC58ppS1Huy2mG3+mGIix/KgjH109NXS9AOPKCFkJ 7TiuqynPQi7aWHM1DyZXESiWKOycW70Wqy4qIbdss1W5SfF34BkBN/I0xwbAcSjj5QW3 1R9HHpVz/FFF3kxzSPWgaKT1gBEQgYtTe8Ow84bV6v5bC3o4IoCbWA7gWjWIoQWy5BrW sMbzFlHXiiYqcXLZpsOhrvVAA3FbDto+7WSIgQiGdK7oDoG2ezzr1iI5GZzVHztICCSQ +MEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=pFy8vNjUkvb20SnqRdW9btHuj7tk88Sq/qU4+6ortMQ=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=rupaIq/EWxfFLc1rmy89vCLnL6lePyMBtTeBwwy0es5p1/8AJns/cFsGPozUoii84r zxoKBCs5rkiNyPiaIk3n1bSl5yM3WoURb9KcZDg13ZtPKox8ZVy12+A+8xruHn+V9G/m 8HA6CiM3tUNWJGo5VD21/UF8bnOiM5vC+P30GeNte9i0F6IAYn4pKv4v0IeOYXbTIbpM YIB4K3u5vi6pavJGL20PAgSWf+X2JbeLkQsGcWewzK47LLCdiL8cGbnHkK6qsFAHf/u5 JU1A6VsfVYwiR3+rJyPXCkBNss97W2CG13xuvsg9DKzT3WN4TeVao5dBHUN+bkVZW1qN Y1vQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=gbQcdvCT; 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 38308e7fff4ca-2eee17ad563si24287351fa.147.2024.07.17.04.27.59; Wed, 17 Jul 2024 04:27:59 -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; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=gbQcdvCT; 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 48F6868D892; Wed, 17 Jul 2024 14:27:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D5B3D68D92E for ; Wed, 17 Jul 2024 14:27:47 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EE7B9240005 for ; Wed, 17 Jul 2024 11:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1721215667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jZtuZzaJo14syPRnA75whQ0rRRQALmE9Gk0bngFDZGY=; b=gbQcdvCT63tWwuU8tLLdLHwQ+JbWKRiit0tx55BYxRrmgOI7Z1NPZQXdRhWa3M29myyNex 1DZrGiy5GozxIK6FGKoQSHV8s6KE6VLNsvbclw/SrF9Rs6oouMIiUBAb14khmQQmWkW1GO y1Tppfg/07Moh1shKtHmeA3fmw1eA2oS3+/z23BGGNi5CHC04Mq3eY2FLmm5mTpfyT0xei zhgeMOSCbZ8OW/T2EgK7Ie351hbiaYM6Zg6VKfujDpaJsIZoNoOFVI05Q4PXszfn5U1ID4 Jjf9OjFVlo4ARGQXvcuhISjwMmtEsThP/5UyRhkU+xaZS11PLEWDqQPUPuuxBQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 17 Jul 2024 13:27:41 +0200 Message-ID: <20240717112745.1624968-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/5] avutil/timecode: Use a 64bit framenum internally 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: gzIccgtcr/rf Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 68550/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6424065930756096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavutil/timecode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavutil/timecode.c b/libavutil/timecode.c index bd879bd3cc0..f40a10eb385 100644 --- a/libavutil/timecode.c +++ b/libavutil/timecode.c @@ -100,11 +100,12 @@ uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss return tc; } -char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum) +char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum_arg) { int fps = tc->fps; int drop = tc->flags & AV_TIMECODE_FLAG_DROPFRAME; int hh, mm, ss, ff, ff_len, neg = 0; + int64_t framenum = framenum_arg; framenum += tc->start; if (drop)