--- replex.c.orig 2007-06-19 11:30:08.000000000 +0200 +++ replex.c 2008-04-05 20:40:32.000000000 +0200 @@ -1586,9 +1586,9 @@ void pes_id_out(pes_in_t *p) fframe = p->buf[9+p->hlength+3]; fframe |= (p->buf[9+p->hlength+2]<<8); - if (fframe < p->plength){ + if (fframe > 0 && fframe < p->plength){ if ((c=find_audio_s(p->buf, - 9+p->hlength+4+fframe, + 9+p->hlength+4+fframe-1, AC3, p->plength+6)) >= 0){ rx->scan_found = id; //fprintf(stderr,"0x%04x 0x%04x \n",