avformat/dhav: Fix second integer overflow in get_duration()

Fixes: ada-2-poc.dhav

Found-by: Claude and Ada Logics. This issue was found by Anthropic from using agents to study security of open source projects, and I am from Ada Logics helping validate the found issues and report to maintainers.
(cherry picked from commit 50e65074f5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
David Korczynski
2026-05-20 15:15:01 -07:00
committed by Michael Niedermayer
parent 82f8e69d52
commit 01c828bac1
+1 -1
View File
@@ -279,7 +279,7 @@ static int64_t get_duration(AVFormatContext *s)
}
}
if (pos < buffer_pos || pos + 20 > buffer_pos + buffer_size)
if (pos < buffer_pos || pos - buffer_pos > buffer_size - 20)
goto fail;
date = AV_RL32(buffer + (pos - buffer_pos) + 16);