7
0
Files
nodejs-electron/avif_image_decoder-libavif-1-mode.patch

27 lines
1.1 KiB
Diff

https://github.com/AOMediaCodec/libavif/commit/676aded3501ff453c88a6d9ed1e5b4f33b458f3e
“The 'mode' member of the avifImageMirror struct was renamed 'axis'.”
--- src/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc.old 2023-08-31 10:26:50.417551000 +0200
+++ src/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc 2023-08-31 21:29:35.891337100 +0200
@@ -892,6 +892,11 @@ bool AVIFImageDecoder::UpdateDemuxer() {
// -1: No mirroring.
// 0: The top and bottom parts of the image are exchanged.
// 1: The left and right parts of the image are exchanged.
+
+#if AVIF_VERSION_MAJOR >= 1
+#define mode axis
+#endif
+
int mode = -1;
if (container->transformFlags & AVIF_TRANSFORM_IMIR) {
mode = container->imir.mode;
@@ -922,6 +927,8 @@ bool AVIFImageDecoder::UpdateDemuxer() {
};
orientation_ = kModeAngleToOrientation[mode + 1][angle];
+#undef mode
+
// Determine whether the image can be decoded to YUV.
// * Alpha channel is not supported.
// * Multi-frame images (animations) are not supported. (The DecodeToYUV()