Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bad cast under CachedResourceLoader::preload()
https://bugs.webkit.org/show_bug.cgi?id=268405 rdar://121745788 Reviewed by Brent Fulgham. In CachedResourceLoader::preload() we were calling requestResource(type) to get a resource. Then if the type we requested was `FontResource`, we assumed the the CachedResource returned was a CachedFont and would cast to that type. However, this cast ends up being incorrect in some cases. I suspect this could happen when requesting resources with the same URL but different types. To address the issue, we now check the actual type of the returned CachedResource before casting it. * Source/WebCore/loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::preload): Originally-landed-as: 272448.421@safari-7618-branch (25c1145). rdar://124554524 Canonical link: https://commits.webkit.org/276162@main
- Loading branch information