summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/decoders/qalflacaudiodecoder.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/decoders/qalflacaudiodecoder.cpp b/src/decoders/qalflacaudiodecoder.cpp
index 0083dea..411134c 100644
--- a/src/decoders/qalflacaudiodecoder.cpp
+++ b/src/decoders/qalflacaudiodecoder.cpp
@@ -91,7 +91,15 @@ QALFlacAudioDecoder::Private::tellCallback(const FLAC__StreamDecoder *decoder, F
{
Q_UNUSED(decoder)
- *absolute_byte_offset = reinterpret_cast<QALFlacAudioDecoder::Private*>(client_data)->file.pos();
+ QFile &tmpFile = reinterpret_cast<QALFlacAudioDecoder::Private*>(client_data)->file;
+ tmpFile.unsetError();
+
+ *absolute_byte_offset = tmpFile.pos();
+
+ if (tmpFile.error() != QFile::NoError) {
+ qWarning() << Q_FUNC_INFO << "Failed to tell the current position:" << tmpFile.errorString();
+ return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
+ }
return FLAC__STREAM_DECODER_TELL_STATUS_OK;
}