aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mmst.c
diff options
context:
space:
mode:
authorZhentan Feng <spyfeng@gmail.com>2010-07-20 15:01:06 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-07-20 15:01:06 +0000
commit9078eba062f5e0463d4029aa42b7b0026f42bed3 (patch)
tree3ba96d0d890e99c5238ce61cb3dbfac8330086ae /libavformat/mmst.c
parent414df121e0a45bb14a2f885d6c5d0a2904643e34 (diff)
downloadffmpeg-9078eba062f5e0463d4029aa42b7b0026f42bed3.tar.gz
Check the status code of each server responses, and fail if it indicates
a problem. Patch by Zhentan Feng <spyfeng gmail com>. Originally committed as revision 24358 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mmst.c')
-rw-r--r--libavformat/mmst.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mmst.c b/libavformat/mmst.c
index 75fb4c6346..7a922bfceb 100644
--- a/libavformat/mmst.c
+++ b/libavformat/mmst.c
@@ -260,6 +260,7 @@ static MMSSCPacketType get_tcp_server_response(MMSContext *mms)
read_result= url_read_complete(mms->mms_hd, mms->in_buffer+8, 4);
if(read_result == 4) {
int length_remaining= AV_RL32(mms->in_buffer+8) + 4;
+ int hr;
dprintf(NULL, "Length remaining is %d\n", length_remaining);
// read the rest of the packet.
@@ -277,6 +278,11 @@ static MMSSCPacketType get_tcp_server_response(MMSContext *mms)
dprintf(NULL, "read for packet type failed%d!\n", read_result);
return -1;
}
+ hr = AV_RL32(mms->in_buffer + 40);
+ if (hr) {
+ dprintf(NULL, "The server side send back error code:0x%x\n", hr);
+ return -1;
+ }
} else {
dprintf(NULL, "read for length remaining failed%d!\n", read_result);
return -1;