From f296c38daf2ba78fd20537672c6bbc28cc9443f4 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 8 Jan 2025 21:51:20 +0100 Subject: [PATCH] xcf: Return early if seek fails BUGS: 498381 --- src/imageformats/xcf.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/imageformats/xcf.cpp b/src/imageformats/xcf.cpp index b05ad4e..b9ebe99 100644 --- a/src/imageformats/xcf.cpp +++ b/src/imageformats/xcf.cpp @@ -900,7 +900,9 @@ bool XCFImageFormat::readXCF(QIODevice *device, QImage *outImage) while (!layer_offsets.isEmpty()) { qint64 layer_offset = layer_offsets.pop(); - xcf_io.device()->seek(layer_offset); + if (!xcf_io.device()->seek(layer_offset)) { + return false; + } if (!loadLayer(xcf_io, xcf_image)) { return false;