This function was added in r254841 under the name BitmapImage::nativeImageForCurrentFrameRespectingOrientation() without checking whether the resulted image of nativeImageForCurrentFrame() is null or not. If the ImageSource is corrupted, the decoder might return a null PlatformImagePtr for the current frame. And if this happens most likely ImageSource::densityCorrectedSize() will return WTF::nullopt also. In this case, we end up calling GraphicsContext::drawPlatformImage() with a null PlatformImagePtr.
<rdar://problem/71907384>
Created attachment 415666 [details] Patch
Committed r270562: <https://trac.webkit.org/changeset/270562> All reviewed patches have been landed. Closing bug and clearing flags on attachment 415666 [details].