From patchwork Wed Jan 23 23:29:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 11852 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 CB20F44D947 for ; Thu, 24 Jan 2019 01:29:56 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ED16F68AC95; Thu, 24 Jan 2019 01:29:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f170.google.com (mail-it1-f170.google.com [209.85.166.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BB85068AC66 for ; Thu, 24 Jan 2019 01:29:37 +0200 (EET) Received: by mail-it1-f170.google.com with SMTP id a6so1755242itl.4 for ; Wed, 23 Jan 2019 15:29:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=R3oExRb1ebypAmBVaKSrnNuuWSQUErzvFowLZA4OnkY=; b=gF/wtFCph3Z4ElZVtkZibQ46Bm0gsNVtC57jfoZ94S9Pct9fimTSr51C99lLnCusRK rrJEUneF/ER2gLc3c+fa0m9q9SGdLUtWfBWyFz6hkXIc3EwGZBio185onswADzHxa9kF HIa4MwJO6dPK3xo8U88hMDbwqzFfkBxPhImAPd7uG/tYZnQ4NT/Iw/ziBQB125TL59sx G7546+dnA1OtvBNjvNhzn1BZNFR98cgQj8VLOjT7yrxc/+Ewt7YTbB9bOM8YztvkWJJ2 65cUYL7b3RAcP1tC/wt1kEuC/eXbzh0eQbbqCQJVHCZ/sX1DRAGWmruzgGUzs2QWksrJ FsFw== 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=R3oExRb1ebypAmBVaKSrnNuuWSQUErzvFowLZA4OnkY=; b=SjrbV/k1frQfuOiXjE0UJcdfWQIC3eYWkR/PGQ3dbOZpBfq4zwaLwIc68D/aK76iKe F9KV9m9wrwCpPdrgh55j2FW02KMxCBlxjtprC/V29X4C/2HRKx7hYSoi8CVavmlJkwA4 /eWknvNQvbzh4aQ5IRQeKnfi5MnI7PGkK3d5GcTp+VaxN5A08BI83Ao9AUQANtOgfBUZ qQMzXvdFufMmqbJKcUBNjnZuKg3Is51NyZp7lzHs1NL3/JF4izE8N8L7B8XfnfdzHMdd 25co8yldARBTBiCU0wp42G2+rdZDPPSWGw2U8GxHnJdpCBh6yoASvZ0kzXSJQ2kryw9f NYjA== X-Gm-Message-State: AHQUAubrEK9PCm1CbePzTs+cCy11eT1wDfHYZI1KriO2MCKYG4TxqTB/ +L3z8yXmZrEbm4qfEG/36XjmpsmU177ZkSh5E4HFiQ== X-Google-Smtp-Source: ALg8bN56oBXYiXZh+QwPwqDnBaQnDMjeZAGpNqDAEHLYUw0FE4Yzt4bIg9MWa05+0yb2+mclDFZ32+oZLz/b/eMoOmc= X-Received: by 2002:a24:b64a:: with SMTP id d10mr85717itj.149.1548286194205; Wed, 23 Jan 2019 15:29:54 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a02:5f11:0:0:0:0:0 with HTTP; Wed, 23 Jan 2019 15:29:53 -0800 (PST) From: Carl Eugen Hoyos Date: Thu, 24 Jan 2019 00:29:53 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavf/subviewerdec: Skip leading BOM 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" Hi! Attached patch fixes ticket #7661 for me. Please comment, Carl Eugen From aa9df8940056919ac7c4b65900a2dd43a76321d2 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Thu, 24 Jan 2019 00:22:47 +0100 Subject: [PATCH] lavf/subviewerdec: Skip leading BOM. Fixes ticket #7661. --- libavformat/subviewerdec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/subviewerdec.c b/libavformat/subviewerdec.c index af084f4..9023a05 100644 --- a/libavformat/subviewerdec.c +++ b/libavformat/subviewerdec.c @@ -27,6 +27,7 @@ #include "avformat.h" #include "internal.h" #include "subtitles.h" +#include "avio_internal.h" #include "libavcodec/internal.h" #include "libavutil/avstring.h" #include "libavutil/bprint.h" @@ -78,6 +79,11 @@ static int subviewer_read_header(AVFormatContext *s) if (!st) return AVERROR(ENOMEM); + res = ffio_ensure_seekback(s->pb, 3); + if (res < 0) + return res; + if (avio_rb24(s->pb) != MKBETAG(0, 0xef, 0xbb, 0xbf)) + avio_seek(s->pb, -3, SEEK_CUR); avpriv_set_pts_info(st, 64, 1, 100); st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codecpar->codec_id = AV_CODEC_ID_SUBVIEWER; -- 1.7.10.4