1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 09:02:38 +00:00
mpv/sub
wm4 d98e61ea43 subreader: fix out of bound write access when parsing .srt
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.
2013-04-30 00:14:26 +02:00
..
ass_mp.c sub: add --osd-blur and --sub-text-blur options 2013-04-13 18:53:03 +02:00
ass_mp.h cleanup: ass_mp.h: remove dummy declarations 2013-01-06 16:22:50 +01:00
dec_sub.c sub, demux: identify subtitle types with the codec name 2013-04-20 23:28:27 +02:00
dec_sub.h sub, demux: identify subtitle types with the codec name 2013-04-20 23:28:27 +02:00
draw_bmp.c sub: don't crash on GBRP video 2013-03-28 21:46:17 +01:00
draw_bmp.h vo_xv, vo_x11: simplify OSD redrawing 2013-01-13 20:04:12 +01:00
find_sub.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
find_subfiles.c path: add mp_find_config_file and reorganize some of the code 2012-12-15 17:38:00 +01:00
find_subfiles.h sub: remove vobsub reader in favor of ffmpeg vobsub demuxer 2012-12-11 00:37:54 +01:00
img_convert.c img_convert: use multiple bounding boxes for ASS->RGBA 2013-01-13 20:04:16 +01:00
img_convert.h img_convert: add sub_bitmap bounding box functions 2013-01-13 20:04:16 +01:00
osd_dummy.c
osd_font.otf osd: convert OSD font to OpenType 2013-04-27 18:03:19 +02:00
osd_libass.c osd_libass: actually free ASS_Tracks 2013-04-12 19:02:58 +02:00
sd_ass.c sub, demux: identify subtitle types with the codec name 2013-04-20 23:28:27 +02:00
sd_lavc.c sub, demux: identify subtitle types with the codec name 2013-04-20 23:28:27 +02:00
sd.h sub, demux: identify subtitle types with the codec name 2013-04-20 23:28:27 +02:00
spudec.c sub: remove vobsub reader in favor of ffmpeg vobsub demuxer 2012-12-11 00:37:54 +01:00
spudec.h options: remove --ffactor switch 2012-10-24 21:56:35 +02:00
sub.c sub: add --osd-blur and --sub-text-blur options 2013-04-13 18:53:03 +02:00
sub.h sub: add --osd-blur and --sub-text-blur options 2013-04-13 18:53:03 +02:00
subassconvert.c subassconverter: silence clang warning 2013-04-28 09:41:39 +02:00
subassconvert.h
subreader.c subreader: fix out of bound write access when parsing .srt 2013-04-30 00:14:26 +02:00
subreader.h core: display subtitle codec in track listing 2013-04-20 23:28:27 +02:00