[FFmpeg-cvslog] lavf/subviewerdec: Skip leading BOM.

Carl Eugen Hoyos git at videolan.org
Sun Jan 27 15:26:37 EET 2019


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Thu Jan 24 00:22:47 2019 +0100| [d3a69438049b481dd9db1af82fd22494d7560ee4] | committer: Carl Eugen Hoyos

lavf/subviewerdec: Skip leading BOM.

Fixes ticket #7661.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3a69438049b481dd9db1af82fd22494d7560ee4
---

 libavformat/subviewerdec.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/subviewerdec.c b/libavformat/subviewerdec.c
index af084f4856..61eb80af87 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) != 0xefbbbf)
+        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;



More information about the ffmpeg-cvslog mailing list