<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"><div style="FONT-FAMILY: ; COLOR: "><div>If you attempt to receive a stream from an invalid source, (i.e.
<a href="rtsp://non-existing_IP:554/main">rtsp://non-existing_IP:554/main</a>)</div>
<div></div>
<div>then the testRTSPClient application will crash.</div>
<div> </div>
<div></div>
<div>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.</div>
<div></div>
<div></div>
<div> </div>
<div>Steps to reproduce:</div>
<div> </div>
<div></div>
<div>Two modifications are required in testRTSPClient.cpp to show the
problem:</div>
<div> </div>
<div></div>
<div>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</div>
<div>2.) At the end of the shutdown() procedure, comment out the exit(), and
replace with “eventLoopWatchVariable = 1;”</div>
<div> </div>
<div></div>
<div></div>
<div>Then just stream to a non-existing source.</div></div></div></div></div></blockquote><div><br></div>Sorry, but I can't reproduce this. However, I think you may be misunderstanding the purpose of the two lines:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>env->reclaim(); env = NULL;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>delete scheduler; scheduler = NULL; </div><div><br></div><div>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).</div><div><br></div><div>So where exactly is this erroneous call to "Medium::close()" happening?</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>