[FFmpeg-cvslog] r24059 - in trunk/libavformat: rtpdec_asf.c rtpdec_asf.h

mstorsjo subversion
Mon Jul 5 18:46:00 CEST 2010


Author: mstorsjo
Date: Mon Jul  5 18:46:00 2010
New Revision: 24059

Log:
rtpdec_asf: Propagate errors from the chained av_open_input_stream

This fixes the crash in issue 2070.

Modified:
   trunk/libavformat/rtpdec_asf.c
   trunk/libavformat/rtpdec_asf.h

Modified: trunk/libavformat/rtpdec_asf.c
==============================================================================
--- trunk/libavformat/rtpdec_asf.c	Mon Jul  5 16:49:48 2010	(r24058)
+++ trunk/libavformat/rtpdec_asf.c	Mon Jul  5 18:46:00 2010	(r24059)
@@ -91,8 +91,9 @@ static void init_packetizer(ByteIOContex
     pb->buf_end = buf + len;
 }
 
-void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
+int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
 {
+    int ret = 0;
     if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
         ByteIOContext pb;
         RTSPState *rt = s->priv_data;
@@ -108,11 +109,14 @@ void ff_wms_parse_sdp_a_line(AVFormatCon
             av_close_input_stream(rt->asf_ctx);
             rt->asf_ctx = NULL;
         }
-        av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
+        ret = av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
+        if (ret < 0)
+            return ret;
         rt->asf_pb_pos = url_ftell(&pb);
         av_free(buf);
         rt->asf_ctx->pb = NULL;
     }
+    return ret;
 }
 
 static int asfrtp_parse_sdp_line(AVFormatContext *s, int stream_index,

Modified: trunk/libavformat/rtpdec_asf.h
==============================================================================
--- trunk/libavformat/rtpdec_asf.h	Mon Jul  5 16:49:48 2010	(r24058)
+++ trunk/libavformat/rtpdec_asf.h	Mon Jul  5 18:46:00 2010	(r24059)
@@ -30,7 +30,7 @@
  *
  * @param s RTSP demux context
  */
-void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p);
+int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p);
 
 /**
  * Handlers for the x-asf-pf payloads (the payload ID for RTP/ASF).



More information about the ffmpeg-cvslog mailing list