diff options
author | Martin Storsjö <martin@martin.st> | 2010-07-05 16:46:00 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-07-05 16:46:00 +0000 |
commit | 0fca8d24ee00284652eecedaa1f922641cdc59b1 (patch) | |
tree | b339db88b18a94f899fdd85147e8d177e6b0b892 | |
parent | 748db0fcc486417225d4cb45d7d5488a00dcc4e3 (diff) | |
download | ffmpeg-0fca8d24ee00284652eecedaa1f922641cdc59b1.tar.gz |
rtpdec_asf: Propagate errors from the chained av_open_input_stream
This fixes the crash in issue 2070.
Originally committed as revision 24059 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/rtpdec_asf.c | 8 | ||||
-rw-r--r-- | libavformat/rtpdec_asf.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c index 09ec6abc0e..340b7cc441 100644 --- a/libavformat/rtpdec_asf.c +++ b/libavformat/rtpdec_asf.c @@ -91,8 +91,9 @@ static void init_packetizer(ByteIOContext *pb, uint8_t *buf, int len) 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(AVFormatContext *s, const char *p) 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, diff --git a/libavformat/rtpdec_asf.h b/libavformat/rtpdec_asf.h index 35873bda0c..dbd85dc846 100644 --- a/libavformat/rtpdec_asf.h +++ b/libavformat/rtpdec_asf.h @@ -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). |