From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id EDE1249D30 for ; Mon, 8 Apr 2024 19:04:04 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D4C1968D2D1; Mon, 8 Apr 2024 22:04:01 +0300 (EEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4426C68CF59 for ; Mon, 8 Apr 2024 22:03:55 +0300 (EEST) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1e40042c13eso9840875ad.2 for ; Mon, 08 Apr 2024 12:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712603032; x=1713207832; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=DF1Xg8JosYRPhCOgVq8fPbC//rIfkUSJPMp629oNjYE=; b=LfvfBajaIuLV9ftwoIL6ZKIXnhKfOYOTD2EBZpsikBlMstfdjkxg/YVfRUNKZn+m/m E4+2r2UAzygZHmAmzXX/x531Qi+Vkc+XXtUp1W/CLFGGVUxLP2OEFG3sFHIys1R2xWjb /jeQAy1kbphpfk2wGDERL9YnIkArjKFMdcOrf1COOUgyQ+0xoIHhuG+EBbU9+O12+wn/ zMeCqfzAnJb9eF84EPyVKllAFohlZfrYb3LcMP2EEcRAAjQOoXeD4RtEnDIwXyatkt1A 8xynUXEDeorZ3pTDOpEpwX0nelpsJDhDel46BOrgkdDYErEZmNffBD22VEu0VzlDizrs qlDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712603032; x=1713207832; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DF1Xg8JosYRPhCOgVq8fPbC//rIfkUSJPMp629oNjYE=; b=YTMxv4EnOPJPdTO+hKI5as98x3xw60FTqGGNH/Ftgaw4Ld7HPIQaORJ03QHP4KCoYk FMAierTwUNV7O2YAQce90wpd4m7ufoF6saHKHxebI/MY5dS9eltLaNSAv2CMqu2AMC6R BKiKqZRa7dmPdWvXeLG+akYhFnP0utQunVw68AUPJXBT1QIWl9+smVfnbOjzikLov0I3 ib4Ofrd93YpPR7hg+G7Ov3S+fwO1A4xITCpL/YcbXkPrQAY025UCSV1ihHlTtd8sdjJH s82ddWWBwSTKebCH7tuNM+tj6nT3lg7gvQWCdKLOBWdwCdqQ9XUpuZcp/id1AygOfOxY Jf7A== X-Gm-Message-State: AOJu0YxS2RDV0pWW30kQCgdd68mR4nEVcuhMUzltA/cgYtMnmo73RPtu rWZ5eWv1KEuK9IWSccjC5499OoOxjQ81sGGLl7Ic01p3V2Nh6+I3s8DZwVwG X-Google-Smtp-Source: AGHT+IEMTyTz2s75QFcVdaoC+ZY32jzRipxyrEvze5GgS2cYiy7bmUdTO9LXkQFZr9wJRPCoKVlXsA== X-Received: by 2002:a17:902:d1d1:b0:1e2:afa8:d706 with SMTP id g17-20020a170902d1d100b001e2afa8d706mr5915524plb.58.1712603032123; Mon, 08 Apr 2024 12:03:52 -0700 (PDT) Received: from [192.168.0.16] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id w12-20020a170902d3cc00b001dca3a65200sm7352716plb.228.2024.04.08.12.03.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Apr 2024 12:03:50 -0700 (PDT) Message-ID: <066c7f03-a1a8-49c9-a576-abac50755a96@gmail.com> Date: Mon, 8 Apr 2024 16:03:52 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240408182051.514137-1-post@frankplowman.com> Content-Language: en-US From: James Almer In-Reply-To: <20240408182051.514137-1-post@frankplowman.com> Subject: Re: [FFmpeg-devel] [PATCH] lavc/vvc_parser: Fix integer overflow calculating framerate 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 4/8/2024 3:20 PM, Frank Plowman wrote: > num_units_in_tick and time_scale are both 32-bit unsigned integers. > Storing them as ints was causing overflows. > > Signed-off-by: Frank Plowman > --- > libavcodec/vvc_parser.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/vvc_parser.c b/libavcodec/vvc_parser.c > index a6a5be27ae..e3501fa139 100644 > --- a/libavcodec/vvc_parser.c > +++ b/libavcodec/vvc_parser.c > @@ -191,8 +191,8 @@ static void set_parser_ctx(AVCodecParserContext *s, AVCodecContext *avctx, > > if (sps->sps_ptl_dpb_hrd_params_present_flag && > sps->sps_timing_hrd_params_present_flag) { > - int num = sps->sps_general_timing_hrd_parameters.num_units_in_tick; > - int den = sps->sps_general_timing_hrd_parameters.time_scale; > + uint32_t num = sps->sps_general_timing_hrd_parameters.num_units_in_tick; > + uint32_t den = sps->sps_general_timing_hrd_parameters.time_scale; > > if (num != 0 && den != 0) > av_reduce(&avctx->framerate.den, &avctx->framerate.num, LGTM. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".