diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index d8f9fc91ba..4152d035e0 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -3617,7 +3617,7 @@ static int mxf_read_close(AVFormatContext *s) static int mxf_probe(const AVProbeData *p) { const uint8_t *bufp = p->buf; - const uint8_t *end = p->buf + p->buf_size; + const uint8_t *end = p->buf + FFMIN(p->buf_size, RUN_IN_MAX + 1 + sizeof(mxf_header_partition_pack_key)); if (p->buf_size < sizeof(mxf_header_partition_pack_key)) return 0;