1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 13:17:13 +00:00

player: fix crash when taking screenshots in idle mode

mpctx->filename is obviously not set if no file is playing.

When this code was written, it probably couldn't happen, because the
normal screenshot path fails much earlier in idle mode. But you can
still take screenshots in "full window" mode, and recently the
screenshot code was changed to use the "full window" mode if the normal
path does not work.

(cherry picked from commit ca474d22c9)
This commit is contained in:
wm4 2015-03-11 12:02:31 +01:00 committed by Diogo Franco (Kovensky)
parent 50b74bf407
commit eaa5393c4a

View File

@ -167,6 +167,8 @@ static char *create_fname(struct MPContext *mpctx, char *template,
}
case 'f':
case 'F': {
if (!mpctx->filename)
goto error_exit;
char *video_file = mp_basename(mpctx->filename);
if (video_file) {
char *name = video_file;