aviobuf: Handle a NULL buffer in avio_close_dyn_buf
authorMartin Storsjö <martin@martin.st>
Wed, 30 Oct 2013 17:09:30 +0000 (19:09 +0200)
committerMartin Storsjö <martin@martin.st>
Fri, 1 Nov 2013 07:56:27 +0000 (09:56 +0200)
commitd07b51bf0733fe58bbfa13c448775dc325463cb4
treeedc522a1a85fc8b04333b6a420cb4842faab35d6
parent28240a60c1b5ce276e947ba013271ec009adc078
aviobuf: Handle a NULL buffer in avio_close_dyn_buf

This simplifies proper error handling in rtsp.c/rtspdec.c. When
broadcasting over RTSP in TCP mode, the AVIOContext is closed and
recreated for each sent packet, and if the recreation fails, we might
try to close a NULL buffer when freeing things at the end.

Previously, if recreating the buffer in rtspdec.c failed, this would
crash later due to trying to close a NULL buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/aviobuf.c