summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-26 18:58:40 +0100
committerwm4 <wm4@nowhere>2014-01-31 19:06:58 +0100
commit02513cd5df18e66b145d7683e9cdfd97319e307d (patch)
treead91ca9dc5a685e5c0a7f4eebe58fee9ea783abf /player
parent4d986d2a9871c77f3dab21acd38e070378a48f42 (diff)
downloadmpv-02513cd5df18e66b145d7683e9cdfd97319e307d.tar.bz2
mpv-02513cd5df18e66b145d7683e9cdfd97319e307d.tar.xz
sub: fix crash with certain uses of --vf=sub
If, for some reason, the subtitle renderer attempts to render a subtitle before SD_CTRL_SET_VIDEO_PARAMS was called, it passed a value calculated from invalid values. This can happen with --vf=sub and --start. The crash happens if 1. there was a subtitle packet that falls into the timestamp of the rendered video frame, 2. the playloop hasn't informed the subtitle decoder about the video resolution yet (normally unneeded, because that is used for weird corner cases only, so this code is a bit fuzzy), and 3. something actually requests a frame to be drawn from the subtitle renderer, like with vf_sub. The actual crash was due to passing NaN as pixel aspect to libass, which then created glyphs with ridiculous sizes, involving a few integer overflows and unchecked mallocs. The sd_lavc.c and sd_spu.c cases probably don't crash, but I'm not sure, and it's better fix them anyway. Not bothering with sd_spu.c, this crap is for compatibility and will be removed soon. Note that this would have been no problem, had the code checked whether SD_CTRL_SET_VIDEO_PARAMS was actually called. This commit adds such a check (although it basically checks after using the parameters). Regression since 49caa0a7 and 633fde4a.
Diffstat (limited to 'player')
0 files changed, 0 insertions, 0 deletions