From patchwork Wed Nov 22 22:20:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dale Curtis X-Patchwork-Id: 44751 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bca6:b0:181:818d:5e7f with SMTP id fx38csp199193pzb; Wed, 22 Nov 2023 14:21:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiVZxGtOKlOBmIGhi2XnmhdhJT4nbd2b+hYeF4X48GCxtuV+VpB3fM1bxi+tx/qpnETbRR X-Received: by 2002:a17:906:da:b0:a02:a2cc:66b8 with SMTP id 26-20020a17090600da00b00a02a2cc66b8mr1188922eji.14.1700691688725; Wed, 22 Nov 2023 14:21:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700691688; cv=none; d=google.com; s=arc-20160816; b=j/tJZCDGuAvCO+k+tNLGQP1vite1OyYEKUG/S2UediIWP9KmSe08UfAp8eDHS1V7I6 dCc8YdppLMfX/Gg46PTaGx7wJWDCMGyoncVKnEUXWAy5qjHMe7+WylBCOflYy1fhtwla vU/JTHDV6IhzNZv8f+6+s4yMr36+2EaXXzGWXwKy61p9XASvB5jVZxEagyZucU8f8YmW ah8Hhl6TTOOMjVZF/hj51Q3zetdSE53ZNATmV/XUd0TmGWd+Mzxj8RY9L3l3KwBMMFfk vxORthPKm3MxNgB2g1esVNJ5mWi985lvbR6P5kGk7wWUWItZEujsmj3bw7PVQLZlGkFC wDkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=Mk3mtNxqvZ0NQFJgroQD3sEpJG7S6ro43S/2lRVJbRU=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=YyWzecBKKmbt0NkHbkaKIiXz8hB4iPGf0atMpcFsPs/6rKV98TKmZEn9RPh9hOUih0 3H4rMu++ZWwo57IKxIuFWDzdhfcnBNv6L8AuJgcoz+ygMBnyZ1Fn9mlPtnZZiu+AfRjm htuSDusiTADrfOkLypA+YneUEd7ZukE6ZRFv+Q5s116cj4NEKh7DRzesDYvveQbJGFKw dxlyzcM8OfZkxfILIWC2abEaQZ1A/gesxPXi9clTB2T2IFVKdjKyYdYxuA1A9fXltKNp BoV901b4OxBazkJpTmmVuqmegYy4cuEN199lgDbQ0MwRlT0hYzr9VuKqGJKpDRqQAgKB 8pRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@chromium.org header.s=google header.b=dyIpnwYI; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g14-20020a1709067c4e00b00992ee6da4b2si217553ejp.683.2023.11.22.14.21.27; Wed, 22 Nov 2023 14:21:28 -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; dkim=neutral (body hash did not verify) header.i=@chromium.org header.s=google header.b=dyIpnwYI; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A32EB68CEFA; Thu, 23 Nov 2023 00:21:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FA8968C5BA for ; Thu, 23 Nov 2023 00:21:17 +0200 (EET) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40b35199f94so22665e9.0 for ; Wed, 22 Nov 2023 14:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1700691676; x=1701296476; darn=ffmpeg.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Gwr7gyQ4kko7ehEFXjfW93d2+UYdp2LlNFJp7agtrAk=; b=dyIpnwYICY4DczXMsgugEKNi/+sxnGulQfBMHZt0Bo5zepaxt4iTiJUIJL/fJp3wcs yk9VLC2gDAeCTFb5ENgpQjxwTZ9z0w+LQZiPt53lFRurgkDKwmg1/Ult52UuPHM0GVbk r9DjoIkvrC21GTiFF6bZOSc0nA9xJf6SlpQD8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700691676; x=1701296476; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Gwr7gyQ4kko7ehEFXjfW93d2+UYdp2LlNFJp7agtrAk=; b=Y3qFW/4swBQk7G8xIVDY4NiKIhLpkgY6zBQDhGfTz+nqcnQNikvxdEWBTfTXidWZkF XFm0bJvD0WYJQ1uz+nHe011yU2mud7Qm/62VRl62K4fp2a1FTFI/2eu8Rv48RvFlhP0J NxffuqIoKN7sFo6T9WJy8VoFhp9rnmuQ9JBn82YnKHgSxxQl4UnUOoXnA1KEkCChdEWA jpdSHbBqprSCz7uVey6iNaNN662eEkQ2fL3JktgloGG6IUltxXV2OCT3AeAntAY9Vmw2 lJLd+tBZlaOnCrK4WIpjT9KvaJxBdafm4HiKpRBUKVfazzcUlDDYV4XN0BchQnsLw/YZ /Eaw== X-Gm-Message-State: AOJu0Yx0XoQhLXqiMHXrkPFBxIwUGvg8WktO20Bj/Pnfa2vfHTaqx3bx MawSYgz+Vfa9y2Q/vvZ/HlA7fon8v7TFrZd0V9tWF9ipSIR36RvT0ftMxw== X-Received: by 2002:a05:600c:5112:b0:40b:2979:9cc2 with SMTP id o18-20020a05600c511200b0040b29799cc2mr178279wms.1.1700691675489; Wed, 22 Nov 2023 14:21:15 -0800 (PST) MIME-Version: 1.0 From: Dale Curtis Date: Wed, 22 Nov 2023 14:20:59 -0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] Fix integer overflow in mov_read_packet(). 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: QcnGqrlVisJl Fixes https://crbug.com/1499669: runtime error: signed integer overflow: 9223372036853334272 + 1375731456 cannot be represented in type 'int64_t' (aka 'long') Signed-off-by: Dale Curtis --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) /* update ctts context */ sc->ctts_sample++; if (sc->ctts_index < sc->ctts_count && -- diff --git a/libavformat/mov.c b/libavformat/mov.c index 93f202d204..425ddc6849 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -9023,7 +9023,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) pkt->flags |= AV_PKT_FLAG_DISCARD; } if (sc->ctts_data && sc->ctts_index < sc->ctts_count) { - pkt->pts = pkt->dts + sc->dts_shift + sc->ctts_data[sc->ctts_index].duration; + pkt->pts = av_sat_add64(pkt->dts, av_sat_add64(sc->dts_shift, sc->ctts_data[sc->ctts_index].duration));