UC Bug Report (+solution) - RTSP server crashes during multi-subsession stream if only 1 subsession SETUP called

Collins, Thomas I TICOLLINS at qinetiq.com
Wed Apr 19 04:16:39 PDT 2023


Hi,

I have discovered a bug which causes our application to crash (boost lock terminate).

We have an RTSP server with 2 subsessions (video+audio). If an RTSP client requests to stream just one subsession (SETUP called only on 1 track) [video or audio] the server will crash.

I have debugged the source code and fixed by altering the following:

In 'RTSPServer.cpp':
            Within the 'handleCmd_PLAY' function the following checks 'fStreamStates[i].subsession != NULL' needs to be 'fStreamStates[i].streamToken!= NULL':

  // Do any required seeking/scaling on each subsession, before starting streaming.
  // (However, we don't do this if the "PLAY" request was for just a single subsession
  // of a multiple-subsession stream; for such streams, seeking/scaling can be done
  // only with an aggregate "PLAY".)
  for (i = 0; i < fNumStreamStates; ++i) {
    if (subsession == NULL /* means: aggregated operation */ || fNumStreamStates == 1) {
      if (fStreamStates[i].subsession != NULL) {



      for (i = 0; i < fNumStreamStates; ++i) {
            if (subsession == NULL /* means: aggregated operation */
                || subsession == fStreamStates[i].subsession) {
              if (fStreamStates[i].subsession == NULL) continue;


  // Now, start streaming:
  for (i = 0; i < fNumStreamStates; ++i) {
    if (subsession == NULL /* means: aggregated operation */
            || subsession == fStreamStates[i].subsession) {
      unsigned short rtpSeqNum = 0;
      unsigned rtpTimestamp = 0;
      if (fStreamStates[i].subsession == NULL) continue;

N.B I have omitted line numbers as my source might not be the absolute latest.

Cheers

Thomas Collins MEng - Engineer
Applied Science, Security Technologies
Tel: 01684 894972 | Mob: 07968 513075 | Email: ticollins at qinetiq.com<mailto:ticollins at qinetiq.com>

Malvern Technology Centre WR14 3PS (CB A221)

[logo.png]

www.QinetiQ.com<http://www.qinetiq.com/>


This email and any attachments to it may be confidential and are
intended solely for the use of the individual to whom it is 
addressed. If you are not the intended recipient of this email,
you must neither take any action based upon its contents, nor 
copy or show it to anyone. Please contact the sender if you 
believe you have received this email in error. QinetiQ retains 
personal data relating to our customers and partners for the 
purposes of conducting a business relationship, communicating
and marketing to them as well as to providing invitations to 
upcoming events.  
Please see our Privacy Notice ( https://www.qinetiq.com/Privacy-Policy )
for further information.  In accordance with our Privacy Notice, you
have the right to withdraw your consent at any time. QinetiQ may 
monitor email traffic data and also the content of email for 
the purposes of security. QinetiQ Limited (Registered in England
& Wales: Company Number: 3796233) Registered office: Cody Technology 
Park, Ively Road, Farnborough, Hampshire, GU14 0LX  https://www.qinetiq.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20230419/881a3379/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2517 bytes
Desc: image001.png
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20230419/881a3379/attachment.png>


More information about the live-devel mailing list