From eaa5393c4a1c7fdc75b5626498e6721d3be59132 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 11 Mar 2015 12:02:31 +0100 Subject: 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 ca474d22c98d678003cf5c94612d874d79eae442) --- player/screenshot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/player/screenshot.c b/player/screenshot.c index 0f0ac72419..27ef468544 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -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; -- cgit v1.2.3