X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fgxf.c;h=b787d4f521f9a3a4aa54fa2ce9cc9b1238138c64;hb=e3d993fab0ad4255dffd10a794fc5e1bd37047b7;hp=399f745bc76a6a247b94c1502ade1af62bf03e11;hpb=762c2b5dcd99a08452299cd1f83070f88115f1f3;p=ffmpeg diff --git a/libavformat/gxf.c b/libavformat/gxf.c index 399f745bc76..b787d4f521f 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -86,7 +86,7 @@ static int parse_packet_header(AVIOContext *pb, GXFPktType *type, int *length) { /** * @brief check if file starts with a PKT_MAP header */ -static int gxf_probe(AVProbeData *p) { +static int gxf_probe(const AVProbeData *p) { static const uint8_t startcode[] = {0, 0, 0, 0, 1, 0xbc}; // start with map packet static const uint8_t endcode[] = {0, 0, 0, 0, 0xe1, 0xe2}; if (!memcmp(p->buf, startcode, sizeof(startcode)) && @@ -285,9 +285,12 @@ static void gxf_track_tags(AVIOContext *pb, int *len, struct gxf_stream_info *si static void gxf_read_index(AVFormatContext *s, int pkt_len) { AVIOContext *pb = s->pb; AVStream *st; - uint32_t fields_per_map = avio_rl32(pb); - uint32_t map_cnt = avio_rl32(pb); + uint32_t fields_per_map, map_cnt; int i; + if (pkt_len < 8) + return; + fields_per_map = avio_rl32(pb); + map_cnt = avio_rl32(pb); pkt_len -= 8; if ((s->flags & AVFMT_FLAG_IGNIDX) || !s->streams) { avio_skip(pb, pkt_len); @@ -572,9 +575,9 @@ static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD); if (idx < 0) return -1; - pos = st->index_entries[idx].pos; - if (idx < st->nb_index_entries - 2) - maxlen = st->index_entries[idx + 2].pos - pos; + pos = st->internal->index_entries[idx].pos; + if (idx < st->internal->nb_index_entries - 2) + maxlen = st->internal->index_entries[idx + 2].pos - pos; maxlen = FFMAX(maxlen, 200 * 1024); res = avio_seek(s->pb, pos, SEEK_SET); if (res < 0)