Check passed pid. Prevents invalid use and possible corruption

of the 'state'.


git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1394 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
nightshad
2011-04-12 09:29:46 +00:00
parent 48d34b432d
commit c042af61d7

View File

@@ -57,6 +57,12 @@ int tuxtxt_stop()
void tuxtxt_start(int tpid, int source) void tuxtxt_start(int tpid, int source)
{ {
if (tpid == -1)
{
printf("tuxtxt: invalid PID!\n");
return;
}
if (tuxtxt_cache.vtxtpid != tpid) if (tuxtxt_cache.vtxtpid != tpid)
{ {
tuxtxt_stop(); tuxtxt_stop();
@@ -79,7 +85,7 @@ void tuxtxt_close()
tuxtxt_stop(); tuxtxt_stop();
#if 0 #if 0
if (tuxtxt_cache.dmx != -1) if (tuxtxt_cache.dmx != -1)
close(tuxtxt_cache.dmx); close(tuxtxt_cache.dmx);
#endif #endif
tuxtxt_cache.dmx = -1; tuxtxt_cache.dmx = -1;
tuxtxt_clear_cache(); tuxtxt_clear_cache();