[Live-devel] testRTSPClient heap corruption
Ross Finlayson
finlayson at live555.com
Tue Apr 17 22:15:32 PDT 2012
> If you attempt to receive a stream from an invalid source, (i.e. rtsp://non-existing_IP:554/main)
> then the testRTSPClient application will crash.
>
> It seems that calling Medium::close() is the culprit. Medium::close() works fine when connected to a valid stream, but will cause heap corruption when not streaming.
>
> Steps to reproduce:
>
> Two modifications are required in testRTSPClient.cpp to show the problem:
>
> 1.) In main(), follow the comments at the end of the procedure, I.e. comment out the “return 0”, and uncomment the last two lines
> 2.) At the end of the shutdown() procedure, comment out the exit(), and replace with “eventLoopWatchVariable = 1;”
>
> Then just stream to a non-existing source.
Sorry, but I can't reproduce this. However, I think you may be misunderstanding the purpose of the two lines:
env->reclaim(); env = NULL;
delete scheduler; scheduler = NULL;
You should execute those lines only if you're *complete done* with the "UsageEnvironment" and "TaskScheduler" objects; i.e. if you don't plan to execute any more "LIVE555 Streaming Media" library code. In particular, you should not be calling "Medium::close()" at all after this point (and that function won't get called from the event loop anymore - because you're no longer in the event loop).
So where exactly is this erroneous call to "Medium::close()" happening?
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120418/a06f7a50/attachment-0001.html>
More information about the live-devel
mailing list