[Live-devel] Possible crash on BufferedPacket deallocation
Eric Beuque
eric.beuque at jet1oeil.com
Wed May 7 22:20:33 PDT 2025
Hello,
I found a crash that can be caused in some circonstance.
I use a RTSPClient reading a video stream from Dahua camera.
I selected a too small MediaSink buffer to get frame, so i stopped the
stream when receiving truncated bytes.
But during 30 seconds (delay for my activity check handler), the RTSP
stream continues to read packets from the camera and create
H265BufferedPacket.
After 30 seconds livemedia shutdown the stream and released the packet.
But due to the recursive deallocation of BufferedPacket, on Windows I
received a crash on the stack size after trying to delete more than 5700
packets.
I can probably fix thing on my side but replacing :
BufferedPacket::~BufferedPacket() {
delete fNextPacket;
delete[] fBuf;
}
by :
BufferedPacket::~BufferedPacket() {
BufferedPacket *nextPacket = fNextPacket;
while (nextPacket != nullptr) {
BufferedPacket *tmpPacket = nextPacket;
nextPacket = tmpPacket->fNextPacket;
tmpPacket->fNextPacket = nullptr;
delete tmpPacket;
}
delete[] fBuf;
}
Fix the crash for me.
Eric BEUQUE - Software architect / developer
T. 03 81 50 51 50 | www.jet1oeil.com
5 rue Victor Considérant, Parc d’Activités de l’Echange 25770 Chemaudin et
Vaux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20250508/533b414d/attachment.htm>
More information about the live-devel
mailing list