From b7f3811b299809cf1d57bd1b5979b54eb1e41765 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 1 May 2005 09:02:25 +0000 Subject: [PATCH] Error out when invalid format is specified git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15312 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_format.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libaf/af_format.c b/libaf/af_format.c index 2969455ac1..48c7e82a35 100644 --- a/libaf/af_format.c +++ b/libaf/af_format.c @@ -139,6 +139,10 @@ static int control(struct af_instance_s* af, int cmd, void* arg) } case AF_CONTROL_COMMAND_LINE:{ int format = af_str2fmt_short(arg); + if (format == -1) { + af_msg(AF_MSG_ERROR, "[format] %s is not a valid format\n", (char *)arg); + return AF_ERROR; + } if(AF_OK != af->control(af,AF_CONTROL_FORMAT_FMT | AF_CONTROL_SET,&format)) return AF_ERROR; return AF_OK;