Bug 224232 - [GTK][WPE] Avif decoder build broken
Summary: [GTK][WPE] Avif decoder build broken
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-06 05:11 PDT by Philippe Normand
Modified: 2021-04-13 04:38 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.02 KB, patch)
2021-04-09 02:41 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2021-04-06 05:11:47 PDT
I´m about to deploy a SDK update shipping avif 0.9.0, the build fails but as this feature is currently disabled by default I think it´s fine ;)

../../Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp:52:9: error: no matching function for call to 'avifDecoderParse'
    if (avifDecoderParse(m_avifDecoder.get(), &avifData) != AVIF_RESULT_OK
        ^~~~~~~~~~~~~~~~
/usr/include/avif/avif.h:752:21: note: candidate function not viable: requires single argument 'decoder', but 2 arguments were provided
         avifResult avifDecoderParse(avifDecoder * decoder);
                    ^
../../Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp:75:13: error: no matching function for call to 'avifDecoderParse'
        if (avifDecoderParse(m_avifDecoder.get(), &avifData) != AVIF_RESULT_OK) {
            ^~~~~~~~~~~~~~~~
/usr/include/avif/avif.h:752:21: note: candidate function not viable: requires single argument 'decoder', but 2 arguments were provided
         avifResult avifDecoderParse(avifDecoder * decoder);
                    ^
../../Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp:125:26: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
    for (size_t i = 0; i < m_avifDecoder->imageCount; ++i) {
                       ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
Comment 1 Philippe Normand 2021-04-09 02:41:37 PDT
Created attachment 425604 [details]
Patch
Comment 2 ChangSeok Oh 2021-04-10 12:05:54 PDT
Comment on attachment 425604 [details]
Patch

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

> Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp:43
> +    if (avifDecoderSetIOMemory(m_avifDecoder.get(), reinterpret_cast<const uint8_t*>(data.data()), data.size()) != AVIF_RESULT_OK) {

Doesn't we need to check if incoming data is compatible to avif or avifs here, first?
Comment 3 Philippe Normand 2021-04-11 05:45:14 PDT
Comment on attachment 425604 [details]
Patch

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

>> Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp:43
>> +    if (avifDecoderSetIOMemory(m_avifDecoder.get(), reinterpret_cast<const uint8_t*>(data.data()), data.size()) != AVIF_RESULT_OK) {
> 
> Doesn't we need to check if incoming data is compatible to avif or avifs here, first?

I don´t think so. The examples I´ve found call avifDecoderSetIOMemory() and then avifDecoderParse() which internally calls avifParse() which should hopefully handle parse errors. Do you think something additional is needed?
Comment 4 EWS 2021-04-13 04:38:33 PDT
Committed r275880 (236445@main): <https://commits.webkit.org/236445@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425604 [details].