From patchwork Tue Sep 1 15:03:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 22051 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 30D44449D9B for ; Tue, 1 Sep 2020 18:30:01 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0B5F868AE45; Tue, 1 Sep 2020 18:30:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8023968010D for ; Tue, 1 Sep 2020 18:29:55 +0300 (EEST) Received: by mail-ej1-f65.google.com with SMTP id p9so2262646ejf.6 for ; Tue, 01 Sep 2020 08:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rNn5i4yAZd+OLdBdAlBgN/dFTRSN/RB4MpW5tXzgrMg=; b=EQ1341NWv7xwxai7Tx537PLVueVcd8F1J3LJ6LM7NvxjuQgNG0LU+/AC9/6Jr06O4h n4/4hvorn4i13LhF1b+gk01Xf8iVH3f/qy+PS3KJFcVSQpd2/T71swZYRSGKpuJbYoUJ mTH9DTjVQ6f0YLD+jixIEhk3RWDsVzfUwXXrKxGa3X91n7fpiovUF1modxP2SdYU+N8q uguA0ObkQ8WP1ZQh7sFzux2Zq8Iobdxxsn8T66t2iHEfaZ9bXM+q1a+QpJj/7i2ccZwf jr6x+X1ScieySATkd/4AVh1/Y1AaIw5PGeM69xC0lRM107BxvdSabgQL6FQOEXSGhuZz /YSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rNn5i4yAZd+OLdBdAlBgN/dFTRSN/RB4MpW5tXzgrMg=; b=OfJXiGxT66DXKEA8hytWzycyKLBMXMY2GVC4E0om4V7TdtR2UwqVBCYsuaYmGcuqdX 8q3jhYT7xYegtUWCthw29twde2o3ocmnSnX4eOdvNMRvWigJpwzh2t5Cq8mXh3uhXIjs dJH34OS+aLHYhUkJe8aAaZkKfcRw6gq3KbaWGPNBzhkLuvHvCnOcW8EXG4cBGc8B9V4z hJWJDqG5lVxYqD3WN+sWcaBUTENfDuR2ELVky+BGmStl5tY17FBbynrK3AioRCp/FpWY 8srbUacS1ilYxeHs5YGW7GIdX1b9c/oXYadEiCAMY7S3XPsQ8xr0LlNFgrIdIV/te4BX sPcg== X-Gm-Message-State: AOAM533Cgs+MMuWOJxm35H/iMbL+pKROhukq+gXsGLb9gBdDN9PFB27K bI8EWhXoPcFMHF711/ley9SUMzOmg2U= X-Google-Smtp-Source: ABdhPJw7cra3uv6dQzM9Z/bYbpcbGpDbR1zCw4BkseWtJwbqEhnspZh8HTppvzKVtdfem4H794qDQQ== X-Received: by 2002:adf:c182:: with SMTP id x2mr2392623wre.400.1598972627029; Tue, 01 Sep 2020 08:03:47 -0700 (PDT) Received: from localhost.localdomain ([81.2.169.31]) by smtp.gmail.com with ESMTPSA id l18sm2655252wrm.52.2020.09.01.08.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 08:03:46 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Sep 2020 16:03:32 +0100 Message-Id: <20200901150335.103855-1-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avformat/mov: Fix return type used for av_seek in mfra code X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: dalecurtis@chromium.org Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It should be a 64-bit integer, otherwise it overflows and fails on files greater than 2GB on some systems like x86_64 Linux. Signed-off-by: Derek Buitenhuis --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index dcec74662d..f0b4edc2ed 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -5095,7 +5095,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom) // See if the remaining bytes are just an mfra which we can ignore. is_complete = offset == stream_size; if (!is_complete) { - int ret; + int64_t ret; int64_t original_pos = avio_tell(pb); int32_t mfra_size; if ((ret = avio_seek(pb, stream_size - 4, SEEK_SET)) < 0)