# HG changeset patch # User arpi_esp # Date 985825115 0 # Node ID 18e5c0f63947f614819f9e08b3b539bb416507e6 # Parent 7ac45cb428c535fd924254e13030eec768bfea24 fix: packet longer than 4096 bytes diff -r 7ac45cb428c5 -r 18e5c0f63947 demux_mpg.c --- 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