[xiph-commits] r13800 - trunk/ezstream/src
moritz at svn.xiph.org
moritz at svn.xiph.org
Thu Sep 13 23:59:28 PDT 2007
Author: moritz
Date: 2007-09-13 23:59:28 -0700 (Thu, 13 Sep 2007)
New Revision: 13800
Modified:
trunk/ezstream/src/playlist.c
Log:
If there are no playlist entries, dereferencing pl->list causes a segfault.
Fix this by checking pl->num early.
Modified: trunk/ezstream/src/playlist.c
===================================================================
--- trunk/ezstream/src/playlist.c 2007-09-14 03:09:32 UTC (rev 13799)
+++ trunk/ezstream/src/playlist.c 2007-09-14 06:59:28 UTC (rev 13800)
@@ -287,6 +287,9 @@
if (pl->program)
return (playlist_run_program(pl));
+ if (pl->num == 0)
+ return (NULL);
+
return ((const char *)pl->list[pl->index++]);
}
@@ -299,7 +302,7 @@
exit(1);
}
- if (pl->program)
+ if (pl->program || pl->num == 0)
return (NULL);
return ((const char *)pl->list[pl->index]);
@@ -314,7 +317,7 @@
exit(1);
}
- if (pl->program)
+ if (pl->program || pl->num == 0)
return;
if (pl->list[pl->index] != NULL)
More information about the commits
mailing list