diff --git a/libavformat/dhav.c b/libavformat/dhav.c index 449e5bfb0a..598780e8b8 100644 --- a/libavformat/dhav.c +++ b/libavformat/dhav.c @@ -252,7 +252,7 @@ static int64_t get_duration(AVFormatContext *s) int64_t size = avio_size(s->pb); int64_t ret = 0; - if (start_pos + 20 > size) + if (start_pos < 0 || start_pos > size - 20) return 0; avio_skip(s->pb, 16);