--- mpg123~/common.c 2001-05-16 16:56:56 +0000 +++ mpg123/common.c 2003-08-04 10:22:28 +0000 @@ -127,7 +127,7 @@ int head_check(unsigned long head) return FALSE; if(!((head>>17)&3)) return FALSE; - if( ((head>>12)&0xf) == 0xf) + if(((head>>12)&0xf) == 0xf || ((head>>12)&0xf) == 0) return FALSE; if( ((head>>10)&0x3) == 0x3 ) return FALSE; @@ -140,7 +140,7 @@ int head_check(unsigned long head) * -1: giving up * 1: synched */ -#define MAX_INPUT_FRAMESIZE 1920 +#define MAX_INPUT_FRAMESIZE 4096 #define SYNC_HEAD_MASK 0xffff0000 #define SYNC_HEAD_MASK_FF 0x0000f000 #define LOOK_AHEAD_NUM 3 @@ -237,6 +237,8 @@ fprintf(stderr,"Searching for next FF he } } else { + if(frameInfo.framesize > MAX_INPUT_FRAMESIZE) return 0; + if(!rds->read_frame_body(rds,dummybuf,frameInfo.framesize)) return 0;