X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fbfi.c;h=bff6f0154ecb305d078a8fcf628198a46b4ce4d1;hb=bc70684e74a185d7b80c8b80bdedda659cb581b8;hp=0dad658f959a29cb21315d9aaf51f057217ca49f;hpb=f05f210526a3dc2d9fa6b1c228e3907ebd1d43c6;p=ffmpeg diff --git a/libavformat/bfi.c b/libavformat/bfi.c index 0dad658f959..bff6f0154ec 100644 --- a/libavformat/bfi.c +++ b/libavformat/bfi.c @@ -39,7 +39,7 @@ typedef struct BFIContext { int avflag; } BFIContext; -static int bfi_probe(AVProbeData * p) +static int bfi_probe(const AVProbeData * p) { /* Check file header */ if (AV_RL32(p->buf) == MKTAG('B', 'F', '&', 'I')) @@ -69,6 +69,9 @@ static int bfi_read_header(AVFormatContext * s) /* Set the total number of frames. */ avio_skip(pb, 8); chunk_header = avio_rl32(pb); + if (chunk_header < 3) + return AVERROR_INVALIDDATA; + bfi->nframes = avio_rl32(pb); avio_rl32(pb); avio_rl32(pb); @@ -171,7 +174,7 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt) return ret; } -AVInputFormat ff_bfi_demuxer = { +const AVInputFormat ff_bfi_demuxer = { .name = "bfi", .long_name = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"), .priv_data_size = sizeof(BFIContext),