changeset 4197:374f2cc73d0d

fixed a few possible bugs
author arpi
date Wed, 16 Jan 2002 14:54:56 +0000
parents b75f3bb25261
children 7e2bf04c9a7c
files libmpdemux/demux_asf.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_asf.c	Wed Jan 16 12:24:36 2002 +0000
+++ b/libmpdemux/demux_asf.c	Wed Jan 16 14:54:56 2002 +0000
@@ -155,7 +155,7 @@
             unsigned char flags=asf_packet[3];
             unsigned char segtype=asf_packet[4];
             unsigned char* p=&asf_packet[5];
-            unsigned char* p_end=p+asf_packetsize;
+            unsigned char* p_end=asf_packet+asf_packetsize;
             unsigned long time;
             unsigned short duration;
             int segs=1;
@@ -181,7 +181,7 @@
               if(flags&(8|16)){
                 padding=p[0];p++;
                 if(flags&16){ padding|=p[0]<<8; p++;}
-                mp_msg(MSGT_DEMUX,MSGL_V,"Warning! explicit=%d  padding=%d  \n",plen,asf_packetsize-padding);
+                mp_dbg(MSGT_DEMUX,MSGL_DBG2,"Warning! explicit=%d  padding=%d  \n",plen,asf_packetsize-padding);
               }
             } else {
               // Padding (relative) size
@@ -272,7 +272,7 @@
                 // single segment
                 len=plen-(p-asf_packet);
               }
-              if(len<0 || (p+len)>=p_end){
+              if(len<0 || (p+len)>p_end){
                 mp_msg(MSGT_DEMUX,MSGL_V,"ASF_parser: warning! segment len=%d\n",len);
               }
               mp_dbg(MSGT_DEMUX,MSGL_DBG4,"  seg #%d: streamno=%d  seq=%d  type=%02X  len=%d\n",seg,streamno,seq,type,len);