mirror of https://github.com/mpv-player/mpv
d98e61ea43
This broke .srt subtitles on gcc-4.8. The breakage was relatively subtle: it set all hour components to 0, while everything else was parsed successfully. But the problem is really that sscanf wrote 1 byte past the sep variable (or more, for invalid/specially prepared input). The %[..] format specifier is unbounded. Fix that by letting sscanf drop the parsed contents with "*", and also make it skip only one input character by adding "1" (=> "%*1[..."). The out of bound write could easily lead to security issues. Also, this change makes .srt subtitle parsing slightly more strict. Strictly speaking this is an unrelated change, but do it anyway. It's more correct. |
||
---|---|---|
.. | ||
ass_mp.c | ||
ass_mp.h | ||
dec_sub.c | ||
dec_sub.h | ||
draw_bmp.c | ||
draw_bmp.h | ||
find_sub.c | ||
find_subfiles.c | ||
find_subfiles.h | ||
img_convert.c | ||
img_convert.h | ||
osd_dummy.c | ||
osd_font.otf | ||
osd_libass.c | ||
sd.h | ||
sd_ass.c | ||
sd_lavc.c | ||
spudec.c | ||
spudec.h | ||
sub.c | ||
sub.h | ||
subassconvert.c | ||
subassconvert.h | ||
subreader.c | ||
subreader.h |