From f60a41b2446dfd036fc8a163ab0e07c2eeec2082 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sun, 2 Mar 2025 23:40:42 +0000 Subject: [PATCH] IMAGE: Fix calling JPEGDecoder::getPixelFormat() before loading the frame --- image/jpeg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/image/jpeg.cpp b/image/jpeg.cpp index e1340054ea6..b02dd260828 100644 --- a/image/jpeg.cpp +++ b/image/jpeg.cpp @@ -83,7 +83,9 @@ void JPEGDecoder::setCodecAccuracy(CodecAccuracy accuracy) { } Graphics::PixelFormat JPEGDecoder::getPixelFormat() const { - return _surface.format; + if (_surface.getPixels()) + return _surface.format; + return _requestedPixelFormat; } #ifdef USE_JPEG