From patchwork Mon Jan 9 18:47:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Colwell X-Patchwork-Id: 2146 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp7182587vsb; Mon, 9 Jan 2017 10:54:47 -0800 (PST) X-Received: by 10.194.126.225 with SMTP id nb1mr6705296wjb.232.1483988087755; Mon, 09 Jan 2017 10:54:47 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n10si8744870wrb.298.2017.01.09.10.54.47; Mon, 09 Jan 2017 10:54:47 -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=@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 B164C689FF9; Mon, 9 Jan 2017 20:54:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yw0-f180.google.com (mail-yw0-f180.google.com [209.85.161.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 475DD689F7E for ; Mon, 9 Jan 2017 20:54:31 +0200 (EET) Received: by mail-yw0-f180.google.com with SMTP id w75so35282386ywg.1 for ; Mon, 09 Jan 2017 10:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=aKzVBsxHcfA+8ZveAfLks2MD4XCuADHwEa0INL9bkwE=; b=XEZ3ZFSKwh3XyCogLBXThQk5z6idWagHZg1nIR/BDOoakfeATz3vkh/n7geNbe6jNq t62WZJCgFf25HjIXBcQLjmAJm/yr0EYdC3xaCF0+9+as130fMaJxYOC8kgALVYKzeCXb 1lAwGUNh+SKSTfMF4p9VjytcadaUg79q2+BDWYX+snLByYT9oTljVdcMNw9u31MUG6ls psyD77a+Z3R8+t5ETHXc0xGwAiuMlT7ZCi0re0i3ut082b4Vix1zqBepL2SAiXO4LdZ8 P4NMEkCLjFwXIkIfiCP2TrTCbjsY1gjkyQp0VvUblnDHsULDrQV4V/woFnsvYHOuPNoT jceQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=aKzVBsxHcfA+8ZveAfLks2MD4XCuADHwEa0INL9bkwE=; b=Zt6jF/XupSjw1cZHCs4K+y2UHKwc6z9JWpyoIOTbl0/oseCxz2qInD+XiL5KBs61I7 Ul16kTiZWEFlRGEwLz7iODk5GnQWqIQlAP43+Qdh0XG8N0OoeL2dS4wTGE8yU9UGSTVN A2lbWfhFXhApBAs4j7OKJkS3/4uCYRcR3NZHsfFVY06dUD1VkTa7jYCevrCXpTb+WC1g HnvlBShwNcyhiun2CJcgkctTUIKRXlBUKLR5lJjGrVJEBhJIzfedb2R2gwsbrYWdScAL uq3OSVQGAQVDJgTBrHL1Ihb2Kj5G7P7iSoLHbIGXEWin4FSOHWhWljAyj2ZWsX2ATrJT E2qQ== X-Gm-Message-State: AIkVDXLIMe+0rUaIqRUtgpQ+Qs9+JLAuH3D6/E3qRAfn3nrDcWq36HqpUCx090BoXTgP/nd6P8KbJp4RtAlUCV6A X-Received: by 10.129.118.81 with SMTP id j17mr89546557ywk.30.1483987662800; Mon, 09 Jan 2017 10:47:42 -0800 (PST) MIME-Version: 1.0 From: Aaron Colwell Date: Mon, 09 Jan 2017 18:47:31 +0000 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH] mov: Fix spherical metadata_source field parsing. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The attached patch fixes MOV spherical metadata parsing when the metadata_source field is not an empty string. The metadata_source field is a null-terminated string, like other ISOBMFF strings, not an 8-bit length followed by string characters. This patch fixes the parsing code so it skips over the string properly. Aaron From a20866dfeae07a5427e8255145f7fe19d846187d Mon Sep 17 00:00:00 2001 From: Aaron Colwell Date: Mon, 9 Jan 2017 09:58:01 -0800 Subject: [PATCH] mov: Fix spherical metadata_source field parsing. The metadata_source field is a null-terminated string like other ISOBMFF strings not an 8-bit length followed by string characters. This patch fixes the parsing code so it skips over the string properly. --- libavformat/mov.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index d1b929174d..4399d2ab13 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4553,6 +4553,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom) int32_t yaw, pitch, roll; uint32_t tag; enum AVSphericalProjection projection; + int i; if (c->fc->nb_streams < 1) return 0; @@ -4575,7 +4576,11 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } avio_skip(pb, 4); /* version + flags */ - avio_skip(pb, avio_r8(pb)); /* metadata_source */ + + /* metadata_source */ + for (i = 0; i < size - 12; ++i) + if (!avio_r8(pb)) + break; size = avio_rb32(pb); if (size > atom.size) -- 2.11.0.390.gc69c2f50cf-goog