ngraziano / SharpRTSP

A RTSP handling library
Other
557 stars 182 forks source link

Reading error in RTSPListener #102

Closed Revan1985 closed 10 months ago

Revan1985 commented 10 months ago

I have found a bug in the RTSP Listener class. (caused by my last pull request, sorry).

Reading without slicing the memory, will provide incorrect results... I have also added a check for -u in spdfile class. some cameras (chinese mostly) returns an empty url value, breaking the program and causing an Url Parsing exception

ngraziano commented 10 months ago

I have manually merge the correction to RTSPListener.

I have also added a check for -u in spdfile class. some cameras (chinese mostly) returns an empty url value, breaking the program and causing an Url Parsing exception

For this part I am not confident in the correction. value = GetKeyValue(sdpStream); should not be include in the catch block, it will prevent to go to the next line.

Please provide an SDP file or an unit test for this case.

Revan1985 commented 10 months ago

Hi, I have provided an updated version (you were right, the catch prevent next reading), and provided a test with a sdp file for this case.