From patchwork Fri Sep 29 22:58:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 5347 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.61.197 with SMTP id n188csp1307968jan; Fri, 29 Sep 2017 15:58:50 -0700 (PDT) X-Google-Smtp-Source: AOwi7QB+14VLLWj9WliWJxtvBhNcX4egQptdgvwoc1al1DW9cGBzmUKMCuUYrb+pCDlJiC9ibsxA X-Received: by 10.223.171.93 with SMTP id r29mr7660777wrc.217.1506725930004; Fri, 29 Sep 2017 15:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506725929; cv=none; d=google.com; s=arc-20160816; b=ekzr1HZNH596dsNmP9fMtoVqQltMTHTLd47a7p1cZ6Fj/bLpFX7KQA/sB6GnRXbMX3 IqqwqGr9e5B8cyvQmCbtoqz5mZU/rD5c593EeS4NEZK6ew10KdnMe8PhnipKMrBF5vJE reOOt3YhSD4NDqCbU+iRn7gVjw41PvyjWqILDbRzG/uaTxxDpwsIU8/YwBx2Thbfn/os 3DuZI9FPObyzMRSqBH7EHtTuAGgZ1ZoapdFEeaI0oqnd2Jqr+4+DE97wbfSuLTiK5u5x YFDeVuSVSzD35tjraZH0EIk3fwIOOExHxsirdfdX2TkE3nOkiTlItAInsdlSvYeHC1uH q4aA== 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:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=oSlevzq7cX67LD7HX9zEYNltfjgWH7F6lMv+W7Wzmj0=; b=B49ffL23jdFoKaUHzn6EQX53Je6HxIIRByic1ztsSRWGALAQsSnOEn9T3/Tq9d97pT RV/P7Tnyc0jzR+YnCa+vBou1wOD0iTxUAVV07VQcteyZQnLwt8krVJes/MCY8e3Fp/Du rRKrKxbNNqaw1NahzolBYFmn0ZJmaGhFOAopyHlC7UKrGR+GHGoZH3WHh8tlbJvJrK69 czGbhVAl5cdgNfo5OhRpbCJSNSxhV8ZR53UAC4McoGfcuIBochk4sCNj3Y0ertGdN2z3 yAWZU1lxlyQh5hJkyR7SOj7j7AQ8X8302tj+9lplFIHdU/nDvhozgDfpaHn+KTMPYour 0SJA== 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 189si3572469wmi.273.2017.09.29.15.58.49; Fri, 29 Sep 2017 15:58:49 -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; 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 71DCC6899B7; Sat, 30 Sep 2017 01:58:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-2.mx.upcmail.net (vie01a-qmta-pe02-2.mx.upcmail.net [62.179.121.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F15616897C1 for ; Sat, 30 Sep 2017 01:58:27 +0300 (EEST) Received: from [172.31.218.49] (helo=vie01a-dmta-pe07-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dy4Ey-0003ny-VU for ffmpeg-devel@ffmpeg.org; Sat, 30 Sep 2017 00:58:40 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dy4Et-0006ua-8H for ffmpeg-devel@ffmpeg.org; Sat, 30 Sep 2017 00:58:35 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id FayW1w01Z0S5wYM01ayX6R; Sat, 30 Sep 2017 00:58:32 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 30 Sep 2017 00:58:27 +0200 Message-Id: <20170929225829.2890-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH 1/3] lavf/mov: Allow reading very large files. 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: Pablo Montilla MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Pablo Montilla The Sample count in the time-to-sample table is defined as 32-bit unsigned integer by the QT specification. Fixes ticket #6700. --- libavformat/isom.h | 2 +- libavformat/mov.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index 9aea629293..b9380e9dcc 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -52,7 +52,7 @@ struct AVAESCTR; */ typedef struct MOVStts { - int count; + unsigned int count; int duration; } MOVStts; diff --git a/libavformat/mov.c b/libavformat/mov.c index ede9cda9d3..899690d920 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2663,15 +2663,11 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) for (i = 0; i < entries && !pb->eof_reached; i++) { int sample_duration; - int sample_count; + unsigned int sample_count; sample_count=avio_rb32(pb); sample_duration = avio_rb32(pb); - if (sample_count < 0) { - av_log(c->fc, AV_LOG_ERROR, "Invalid sample_count=%d\n", sample_count); - return AVERROR_INVALIDDATA; - } sc->stts_data[i].count= sample_count; sc->stts_data[i].duration= sample_duration;