[webkit-reviews] review granted: [Bug 225183] Handle case where decoding of image lead to an empty one. : [Attachment 427328] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 29 10:09:57 PDT 2021


Eric Carlson <eric.carlson at apple.com> has granted Jean-Yves Avenard [:jya]
<jya at apple.com>'s request for review:
Bug 225183: Handle case where decoding of image lead to an empty one.
https://bugs.webkit.org/show_bug.cgi?id=225183

Attachment 427328: Patch

https://bugs.webkit.org/attachment.cgi?id=427328&action=review




--- Comment #4 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 427328
  --> https://bugs.webkit.org/attachment.cgi?id=427328
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427328&action=review

> Source/WebCore/Modules/mediasession/MediaMetadata.cpp:184
> +	       // Empty image; ignore.

Nit: I don't think this comment is necessary.

> Source/WebCore/html/MediaElementSession.cpp:1160
> +	       ASSERT(sessionMetadata->artworkImage()->data());
>	       artwork = NowPlayingInfoArtwork { sessionMetadata->artworkSrc(),
sessionMetadata->artworkImage()->mimeType(),
sessionMetadata->artworkImage()->data() };

Is there any reason to create the artwork if
`sessionMetadata->artworkImage()->data()` is NULL?

> Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm:314
> +	   ASSERT(nowPlayingInfo.artwork->imageData);
>	   auto nsArtwork = nowPlayingInfo.artwork->imageData->createNSData();

This will crash in a release build, so either the assert isn't necessary or we
should not try to create the artwork if the image data is NULL.


More information about the webkit-reviews mailing list