diff options
author | qrtt1 <chingyichan.tw@gmail.com> | 2010-10-05 14:04:46 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2010-10-05 14:04:46 +0000 |
commit | 42f9582d8da0176130993f02be908bec348ef3e4 (patch) | |
tree | 91cf7cb274af1d328a28692b41717b59b591266c /libavformat/mmst.c | |
parent | 2a26520a97cffeab6b803ce2742ece827e003781 (diff) | |
download | ffmpeg-42f9582d8da0176130993f02be908bec348ef3e4.tar.gz |
Set proper error if server flags indicate that it doesn't support mmst. This
prevents a read-after-close-induced segfault later. Fixes issue 2266.
Patch by qrtt1 <chingyichan dot tw gmail com>.
Originally committed as revision 25349 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mmst.c')
-rw-r--r-- | libavformat/mmst.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mmst.c b/libavformat/mmst.c index 3d12d82b73..57cca5d0d4 100644 --- a/libavformat/mmst.c +++ b/libavformat/mmst.c @@ -547,8 +547,12 @@ static int mms_open(URLContext *h, const char *uri, int flags) err = mms_safe_send_recv(mmst, NULL, SC_PKT_ASF_HEADER); if (err) goto fail; - if((mmst->incoming_flags != 0X08) && (mmst->incoming_flags != 0X0C)) + if((mmst->incoming_flags != 0X08) && (mmst->incoming_flags != 0X0C)) { + av_log(NULL, AV_LOG_ERROR, + "The server does not support MMST (try MMSH or RTSP)\n"); + err = AVERROR_NOFMT; goto fail; + } err = ff_mms_asf_header_parser(mms); if (err) { dprintf(NULL, "asf header parsed failed!\n"); |