[FFmpeg-cvslog] mmst: fix reading uninitialized data for ping packets.

Ronald S. Bultje git
Tue Feb 15 00:59:11 CET 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Mon Feb 14 09:55:14 2011 -0500| [e84314515ac39543641cd148a33b155218df6a74] | committer: Michael Niedermayer

mmst: fix reading uninitialized data for ping packets.

Fixes errors after a few minutes (first ping) when playing back
mmst://wm.bbc.co.uk/wms/bbc7coyopa/bbc7_-_friday_0430.wma
(cherry picked from commit 275189a2bd71cf49d66374c44d3de2262d323460)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e84314515ac39543641cd148a33b155218df6a74
---

 libavformat/mmst.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/libavformat/mmst.c b/libavformat/mmst.c
index ad87bbf..a2b55b5 100644
--- a/libavformat/mmst.c
+++ b/libavformat/mmst.c
@@ -290,8 +290,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
                 return read_result < 0 ? read_result : AVERROR_IO;
             }
             packet_type= AV_RL16(mms->in_buffer+36);
-            hr = AV_RL32(mms->in_buffer + 40);
-            if (hr) {
+            if (read_result >= 44 && (hr = AV_RL32(mms->in_buffer + 40))) {
                 av_log(NULL, AV_LOG_ERROR,
                        "Server sent a message with packet type 0x%x and error status code 0x%08x\n", packet_type, hr);
                 return AVERROR_UNKNOWN;




More information about the ffmpeg-cvslog mailing list