Closed fdintino closed 2 years ago
Thanks for the report, this does sound like a libaom issue. Do you see the issue with all content or just a particular image? Could you attach a sample source file?
If you're using the libavif release, then you picked up libaom 3.5.0, correct?
And could you confirm the platform you're seeing the crash on? I see some Ubuntu and mingw-w64 targets in your workflows.
So far as I can tell, any RGBA image whatsoever triggers it. If you're looking for a specific image, try this one. The "wheels" workflow of pillow-avif-plugin tests against the widest variety of platforms; I've added a test that should fail with this bug so that I can get a full list of platforms that have the issue. (the windows wheels are still not built against the latest libavif and aom, so ignore those for now). I will report back with the results once it finishes running. So far in my local testing I've seen it on every x86 platform I've tried (alpine, ubuntu, centos, and OS X). I can't be sure, but I think that the M1 OS X builds didn't exhibit the issue.
Frankie: Thank you for the bug report.
James: Please check if the stack trace shows the crash occurs when we encode the alpha plane. Could you check if the libaom functions in the stack can handle a monochrome image? Thanks.
I submitted a couple of fixes, one found by the source file and the other when adding a test. I didn't do an exhaustive search, so there still may be others. @fdintino if you get a chance, please give the new version a try.
I can confirm that this fixes the issue I was having. Thanks!
Great, thanks for the update. If you run into any other issues, don't hesitate to reach out.
How to reproduce:
Find an RGBA png and pass it in twice to avifenc to create a sequence, using aom encoding with speed 7 or greater:
And here is the backtrace in gdb:
If I make it so that it never passes
aomUsage
ofAOM_USAGE_REALTIME
by deleting these lines:https://github.com/AOMediaCodec/libavif/blob/607998755a507b97e9ad4b2a2735cdeb3b1f85ba/src/codec_aom.c#L560-L568
I no longer get a segmentation fault.
I suspect this is a bug in libaom, but it came to my attention because I had CI test failures in pillow-avif-plugin when updating to the latest libavif.