From patchwork Sat Aug 17 00:27:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 14561 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 E447B448475 for ; Sat, 17 Aug 2019 03:28:36 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C2B9168AC25; Sat, 17 Aug 2019 03:28:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 69FD468AC51 for ; Sat, 17 Aug 2019 03:28:30 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id z1so3058765wru.13 for ; Fri, 16 Aug 2019 17:28:30 -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=rYsU8dHZqvKqcr4GoJqJS6nvXpA0e4H8q9HeBCjZYaA=; b=OKxtvstbHYoZaoIOKRYh/pO1KYmwciSmNxblhGWXM7peepSH2BgTOBFeWE01ayE0nE BNd10/skJ2X2bz0n4huqaLLWG1x/UvF0R3NmXTPho73HG6miMzQAAO0vOR6mqw9YDdPx yvXqyN3JyW6U0FCHX8RkZb4VpgcQSXH195sZAe2synjvJJBuoJkABHBNHBNFoNL5LnB+ M6bCeXwDzjI1o62yCsWl+ZtLfU0wxUSjAs9l52L/z0OGIXH3tC/b8RzJuAbk10oEPQ0+ x0zWkbw/e1HnWb1TCXMPcuFGijE9CfWTqpY24yOnHA3dLclb3egVlaGn7WIjjJbsou7q RaZA== 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=rYsU8dHZqvKqcr4GoJqJS6nvXpA0e4H8q9HeBCjZYaA=; b=naaSKcf1hC5GJgTzN2sG+v+E4HczdtbGv2sXSN9PwHIhduhqejopetesjb+hZgQ3bR +3MKsEhbaN8eeDTwiYf6ICXDJDNwe6txs5znZ/i1jep9k9hXgOyAD1icXaIlAidAfiMt BUU1+OZjPGZtQR9UITeqGONzVyNwn5I4f9g4y9fARrCMTmiVz5X5Mr+M+BPOIiwm0AMr 3mdGC+y+HlbJOGrW43Vze/PFAQm7vuCcSI092rYHvRrS/WuYVt90qVmNTD1RT0mMeoT4 fHsgXPOHENDnbNxTClcYUSoGdZDZjpxZs8p3ziOJRKISb6P5c5X14rDGuJt7qYEg1xxf g/6Q== X-Gm-Message-State: APjAAAWqKBYc8kYRo9dbaDa5IqiT4bi2AbbsRbCKurAm2q5oJLfhC42V WE4OCllApweQXcJYmNrSdytg6o9D X-Google-Smtp-Source: APXvYqz6QKmFzHICPSzFxdcUdpWSrlBw4IgcnocYzARjoRF/GmyKFyxh331B8JZlyC2KaT1uQGJdkQ== X-Received: by 2002:adf:f6d2:: with SMTP id y18mr13139383wrp.102.1566001709656; Fri, 16 Aug 2019 17:28:29 -0700 (PDT) Received: from localhost.localdomain (ipbcc08b69.dynamic.kabel-deutschland.de. [188.192.139.105]) by smtp.gmail.com with ESMTPSA id 12sm5256377wmi.34.2019.08.16.17.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2019 17:28:28 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 17 Aug 2019 02:27:51 +0200 Message-Id: <20190817002751.7986-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/matroskadec: Fix seeking 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" matroska_reset_status (a function that is used during seeking (among other things)) used an int for the return value of avio_seek which returns an int64_t. Checking the return value then indicated an error even though the seek was successfull for targets in the range of 2GB-4GB, 6GB-8GB, ... This error implied that the status hasn't been reset and in particular, the old level was still considered to be in force, so that ebml_parse returned errors because the newly parsed elements were of course not contained in the previously active and still wrongly considered active master element any more. Addresses ticket #8084. Signed-off-by: Andreas Rheinhardt --- libavformat/matroskadec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 4e20f15792..1ea9b807e6 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -757,7 +757,7 @@ static int matroska_reset_status(MatroskaDemuxContext *matroska, uint32_t id, int64_t position) { if (position >= 0) { - int err = avio_seek(matroska->ctx->pb, position, SEEK_SET); + int64_t err = avio_seek(matroska->ctx->pb, position, SEEK_SET); if (err < 0) return err; }