return AVERROR_INVALIDDATA;
{  found = 0; for (i = 0; i < ts->raw_packet_size; i++) { if (packet[i] == 0x47) { found = 1;  break; } }  if (found) { url_fseek(pb, pos + i, SEEK_SET); continue; } return AVERROR_INVALIDDATA; }
static int handle_packets(AVFormatContext *s, int nb_packets){    MpegTSContext *ts = s->priv_data;    ByteIOContext *pb = &s->pb;    uint8_t packet[TS_FEC_PACKET_SIZE];    int packet_num, len;    ts->stop_parse = 0;    packet_num = 0;    for(;;) {        if (ts->stop_parse)            break;        packet_num++;        if (nb_packets != 0 && packet_num >= nb_packets)            break;        len = get_buffer(pb, packet, ts->raw_packet_size);        if (len != ts->raw_packet_size)            return AVERROR_IO;        /* check paquet sync byte */        /* XXX: accept to resync ? */        if (packet[0] != 0x47)            return AVERROR_INVALIDDATA;        handle_packet(s, packet);    }    return 0;}