Skip to content

Commit

Permalink
lavf/subviewerdec: Skip leading BOM.
Browse files Browse the repository at this point in the history
Fixes ticket #7661.
  • Loading branch information
cehoyos committed Jan 27, 2019
1 parent b5b6f6a commit d3a6943
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libavformat/subviewerdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d3a6943

Please sign in to comment.