Merge pull request #7359 from npt-1707/fix-CVE-2018-5815

parse_qt: possible integer overflow
This commit is contained in:
Lawrence37 2025-04-21 22:40:11 -07:00 committed by GitHub
commit e86bc3f638
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7842,6 +7842,8 @@ void CLASS parse_qt (int end)
while (ftell(ifp)+7 < end) {
save = ftell(ifp);
if ((size = get4()) < 8) return;
if ((int)size < 0) return; // 2+GB is too much
if (save + size < save) return; // 32bit overflow
fread (tag, 4, 1, ifp);
if (!memcmp(tag,"moov",4) ||
!memcmp(tag,"udta",4) ||