IMAGE: Fix calling JPEGDecoder::getPixelFormat() before loading the frame

This commit is contained in:
Cameron Cawley
2025-03-02 23:40:42 +00:00
committed by Filippos Karapetis
parent 1a3a290ce7
commit f60a41b244
+3 -1
View File
@@ -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