summaryrefslogtreecommitdiffstats
path: root/player/screenshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/screenshot.c')
-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;