diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-11-11 02:25:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-14 12:20:15 +0200 |
commit | 8161ebbcc39d14d78dcad43fd6d13bc43e7c267f (patch) | |
tree | da0457d11af6013ad8b3112b3244c12d514eb5b7 | |
parent | 3e6b3d20b21de39c74670fc418df49274210a217 (diff) | |
download | ffmpeg-8161ebbcc39d14d78dcad43fd6d13bc43e7c267f.tar.gz |
avcodec/htmlsubtitles: Fix reading one byte beyond the array
Fixes: fuzz-2-ffmpeg_SUBTITLE_AV_CODEC_ID_SUBRIP_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 04bd1b38ee6b8df410d0ab8d4949546b6c4af26a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/htmlsubtitles.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/htmlsubtitles.c b/libavcodec/htmlsubtitles.c index a2cd40fad3..8b57febd26 100644 --- a/libavcodec/htmlsubtitles.c +++ b/libavcodec/htmlsubtitles.c @@ -146,7 +146,7 @@ void ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in) if (stack[sptr].param[i][0]) av_bprintf(dst, "%s", stack[sptr].param[i]); } - } else if (!tagname[1] && strspn(tagname, "bisu") == 1) { + } else if (tagname[0] && !tagname[1] && strspn(tagname, "bisu") == 1) { av_bprintf(dst, "{\\%c%d}", tagname[0], !tag_close); } else { unknown = 1; |