[webkit-changes] [WebKit/WebKit] 0dfdb1: RenderVideo::videoBox crashes when intrinsic size ...

mwyrzykowski noreply at github.com
Tue Oct 31 15:33:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0dfdb1a307205ee5644fa3f2de3585305328ce71
      https://github.com/WebKit/WebKit/commit/0dfdb1a307205ee5644fa3f2de3585305328ce71
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2023-10-31 (Tue, 31 Oct 2023)

  Changed paths:
    M Source/WebCore/rendering/RenderVideo.cpp

  Log Message:
  -----------
  RenderVideo::videoBox crashes when intrinsic size is zero
https://bugs.webkit.org/show_bug.cgi?id=263990
<radar://116303559>

Reviewed by Alan Baradlay.

LayoutSize::fitToAspectRatio(aspectRatio, ) assumes that aspectRatio is
non-empty as it divides by aspectRatio.height() and aspectRatio.width().

When either are zero, this would result in a floating point exception due to
division by zero.

It's not clear we should add this check to fitToAspectRatio() and based on where
fitToAspectRatio is called, it seems more appropriate to check before the call site.

* Source/WebCore/rendering/RenderVideo.cpp:
(WebCore::RenderVideo::videoBox const):
Ensure that intrinsicSize is not empty.

Canonical link: https://commits.webkit.org/270032@main




More information about the webkit-changes mailing list