Skip to content

Commit

Permalink
Cherry-pick 345ed1b. rdar://116808395
Browse files Browse the repository at this point in the history
    [AVIF Downlevels] Allow pixi property to be missing in AVIF images
    https://bugs.webkit.org/show_bug.cgi?id=270180
    rdar://116808395

    Reviewed by Cameron McCormack.

    If an image is missing the pixi property, decoding its frames will fail because
    we enable AVIF_STRICT_PIXI_REQUIRED when avifDecoder is created. So we need to
    remove this restriction to be compatible with newer OSs and other browsers.

    * Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp:
    (WebCore::AVIFImageReader::AVIFImageReader):

    Canonical link: https://commits.webkit.org/275608@main
  • Loading branch information
shallawa authored and Mohsin Qureshi committed Mar 15, 2024
1 parent 5e2b7d5 commit 455fb12
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ AVIFImageReader::AVIFImageReader(RefPtr<AVIFImageDecoder>&& decoder)
: m_decoder(WTFMove(decoder))
, m_avifDecoder(avifDecoderCreate())
{
// Allow the PixelInformationProperty ('pixi') to be missing in AV1 image
// items. libheif v1.11.0 or older does not add the 'pixi' item property to
// AV1 image items. (This issue has been corrected in libheif v1.12.0.).
// See the definition of AVIF_STRICT_PIXI_REQUIRED in avif.h.
m_avifDecoder->strictFlags &= ~AVIF_STRICT_PIXI_REQUIRED;
}

AVIFImageReader::~AVIFImageReader() = default;
Expand Down

0 comments on commit 455fb12

Please sign in to comment.