From: Martin Storsjö Date: Sun, 6 Nov 2011 21:50:39 +0000 (+0200) Subject: rtsp: Discard the dynamic handler, if it has an alloc function which failed X-Git-Tag: v0.8b1~674 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b3dc857e416f9ec187cb14fd133226456ba7f91;p=platform%2Fupstream%2Flibav.git rtsp: Discard the dynamic handler, if it has an alloc function which failed Signed-off-by: Martin Storsjö --- diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index c673c35..84cf922 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: /[/] */