aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-11-06 23:50:39 +0200
committerMartin Storsjö <martin@martin.st>2011-11-07 11:23:56 +0200
commit4b3dc857e416f9ec187cb14fd133226456ba7f91 (patch)
tree980dde0ef2706a7b10ec4aa686ef0d76af0e0dab /libavformat/rtsp.c
parentb8f02f5b4eeae4bd332e1c0eee75807ba6f5b431 (diff)
downloadffmpeg-4b3dc857e416f9ec187cb14fd133226456ba7f91.tar.gz
rtsp: Discard the dynamic handler, if it has an alloc function which failed
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c673c35572..84cf922c26 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -172,8 +172,11 @@ static void init_rtp_handler(RTPDynamicProtocolHandler *handler,
return;
codec->codec_id = handler->codec_id;
rtsp_st->dynamic_handler = handler;
- if (handler->alloc)
+ if (handler->alloc) {
rtsp_st->dynamic_protocol_context = handler->alloc();
+ if (!rtsp_st->dynamic_protocol_context)
+ rtsp_st->dynamic_handler = NULL;
+ }
}
/* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */