summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-11 12:02:31 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-03-15 20:06:50 +0900
commiteaa5393c4a1c7fdc75b5626498e6721d3be59132 (patch)
tree34adc863fcb48d9dc96674ce7379fdfe23f24cd0
parent50b74bf4079b0c519ea5d80238d1fff033180e70 (diff)
downloadmpv-eaa5393c4a1c7fdc75b5626498e6721d3be59132.tar.bz2
mpv-eaa5393c4a1c7fdc75b5626498e6721d3be59132.tar.xz
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)
-rw-r--r--player/screenshot.c2
1 files changed, 2 insertions, 0 deletions
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;