[FFmpeg-soc] [soc]: r5749 - mms/mmst.c

spyfeng subversion at mplayerhq.hu
Sat Apr 10 07:12:03 CEST 2010


Author: spyfeng
Date: Sat Apr 10 07:12:03 2010
New Revision: 5749

Log:
fix a segmentfault error and move variable p as local variable in if().

Modified:
   mms/mmst.c

Modified: mms/mmst.c
==============================================================================
--- mms/mmst.c	Sat Apr 10 07:07:22 2010	(r5748)
+++ mms/mmst.c	Sat Apr 10 07:12:03 2010	(r5749)
@@ -260,7 +260,6 @@ static MMSSCPacketType get_tcp_server_re
     int read_result;
     MMSSCPacketType packet_type= -1;
     int done;
-    uint8_t *p;
 
     do {
         done= 1;
@@ -325,13 +324,14 @@ static MMSSCPacketType get_tcp_server_re
                         packet_type = SC_PKT_ASF_HEADER;
                         // Store the asf header
                         if(!mms->header_parsed) {
-                            p = av_realloc(mms->asf_header,
+                            void *p = av_realloc(mms->asf_header,
                                               mms->asf_header_size
                                               + mms->pkt_buf_len);
                             if (!p) {
                                 av_freep(&mms->asf_header);
                                 return AVERROR(ENOMEM);
-                            }
+                            } else if (!mms->asf_header)
+                                mms->asf_header = p;
                             memcpy(mms->asf_header + mms->asf_header_size,
                                                  mms->pkt_read_ptr,
                                                  mms->pkt_buf_len);


More information about the FFmpeg-soc mailing list