changeset 242:18e5c0f63947

fix: packet longer than 4096 bytes
author arpi_esp
date Thu, 29 Mar 2001 00:18:35 +0000
parents 7ac45cb428c5
children 9d9f3337d648
files demux_mpg.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/demux_mpg.c	Wed Mar 28 22:55:36 2001 +0000
+++ b/demux_mpg.c	Thu Mar 29 00:18:35 2001 +0000
@@ -31,7 +31,7 @@
 
   len=stream_read_word(demux->stream);
   if(verbose>=3)  printf("PACKET len=%d",len);
-  if(len==0 || len>4096) return -2;  // invalid packet !!!!!!
+  if(len==0 || len>224*1024) return -2;  // invalid packet !!!!!!
 
   while(len>0){   // Skip stuFFing bytes
     c=stream_read_char(demux->stream);--len;
@@ -65,7 +65,7 @@
     c=stream_read_char(demux->stream); hdrlen=c;
     len-=2;
     if(verbose>=3) printf("  hdrlen=%d  (len=%d)",hdrlen,len);
-    if(hdrlen>len) return -1; // invalid header length
+    if(hdrlen>len){ printf("demux_mpg: invalid header length  \n"); return -1;}
     if(pts_flags==2){
       c=stream_read_char(demux->stream);
       pts=read_mpeg_timestamp(demux->stream,c);
@@ -123,9 +123,9 @@
   } else {
     //if(c!=0x0f) printf("  {ERROR5,c=%d}  \n",c);
   }
-  if(verbose>=3) printf("\n");
+  if(verbose>=3) printf(" => len=%d\n",len);
 
-  if(len<=0 || len>4096) return -1;  // Invalid packet size
+  if(len<=0 || len>224*1024) return -1;  // Invalid packet size
   
   if(id>=0x1C0 && id<=0x1DF){
     // mpeg audio