From fe5782c1cecf49651b8a216fc88d90bd6ba311dc Mon Sep 17 00:00:00 2001 From: laaz Date: Fri, 26 Oct 2001 20:48:22 +0000 Subject: [PATCH] Fixed segfault if 0 subtitle found in a file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2492 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mplayer.c b/mplayer.c index 0e05150319..9979a6b5f1 100644 --- a/mplayer.c +++ b/mplayer.c @@ -607,7 +607,8 @@ if(!parse_codec_cfg(get_path("codecs.conf"))){ ||(0==strcmp(&sub_name[l-4],".UTF")))) sub_utf8=1; subtitles=sub_read_file(sub_name); - if(!subtitles) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name); + if (sub_num == 0) printf ("No subtitles found in %s\n",sub_name); + if(!subtitles || sub_num == 0) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name); } #endif