changeset 35270:5816c9e25d29

Error out if an invalid channel list name was specified instead of continuing and reading outside array bounds all over the place.
author reimar
date Tue, 06 Nov 2012 21:48:43 +0000
parents 7b3252fa7761
children 8c16fe658af0
files stream/tv.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/stream/tv.c	Tue Nov 06 21:37:49 2012 +0000
+++ b/stream/tv.c	Tue Nov 06 21:48:43 2012 +0000
@@ -551,10 +551,11 @@
 	}
     }
 
-    if (tvh->chanlist == -1)
+    if (tvh->chanlist == -1) {
 	mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_UnableFindChanlist,
 	    tvh->tv_param->chanlist);
-    else
+        return 0;
+    } else
 	mp_msg(MSGT_TV, MSGL_V, "Selected channel list: %s (including %d channels)\n",
 	    chanlists[tvh->chanlist].name, chanlists[tvh->chanlist].count);