diff mplayer.c @ 2491:c6421946d07c

Fixed segfault if 0 subtitle found in a file.
author laaz
date Fri, 26 Oct 2001 20:48:22 +0000
parents 3248aabc6d1d
children e5bed36e6dea
line wrap: on
line diff
--- a/mplayer.c	Fri Oct 26 19:54:43 2001 +0000
+++ b/mplayer.c	Fri Oct 26 20:48:22 2001 +0000
@@ -607,7 +607,8 @@
 		   ||(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