1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-08 01:19:59 +02:00

Ensure we check if we have animation or not first

This commit is contained in:
noaione 2025-03-03 03:48:18 +07:00
parent 9454ab9d6c
commit b83ec80e7c
No known key found for this signature in database
GPG key ID: C6AA2F30908B72EC

View file

@ -1,5 +1,5 @@
diff --git a/image/decoders/nsJXLDecoder.cpp b/image/decoders/nsJXLDecoder.cpp
index ffb7f3cd51e1d0e480bf8ac5e936a90c11f0c93d..946c0ff8c2b0ab295d500f131b65b07bbc7df032 100644
index ffb7f3cd51e1d0e480bf8ac5e936a90c11f0c93d..378ae56d7fa99fbe8bdea2e689949994bbdf8034 100644
--- a/image/decoders/nsJXLDecoder.cpp
+++ b/image/decoders/nsJXLDecoder.cpp
@@ -45,9 +45,20 @@ nsJXLDecoder::nsJXLDecoder(RasterImage* aImage)
@ -309,7 +309,7 @@ index ffb7f3cd51e1d0e480bf8ac5e936a90c11f0c93d..946c0ff8c2b0ab295d500f131b65b07b
+ case JXL_DEC_SUCCESS: {
+ // Decoding is done. Report the full frame count.
+ if (WantsFrameCount()) {
+ PostFrameCount(mNumFrames);
+ PostFrameCount(mInfo.have_animation ? mNumFrames + 1 : 1);
+ }
+ PostLoopCount(HasAnimation() ? (int32_t)mInfo.animation.num_loops - 1
+ : 0);