summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-10-30 14:34:46 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-10-30 14:34:46 +0100
commit03b52f1c32f4db35e30c745e8bbeb6839a683323 (patch)
treeeb4b68764d5dca1d083e6cc9410724ca4e846057
parent1e9ab4a54fe53bc09416b90b777abcb998954ab1 (diff)
Don't delete data before using it :)
-rw-r--r--coverdatabase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/coverdatabase.cpp b/coverdatabase.cpp
index 89a1d60..75c4a9a 100644
--- a/coverdatabase.cpp
+++ b/coverdatabase.cpp
@@ -85,9 +85,9 @@ QByteArray CoverDatabase::fetchImageData(const QByteArray &coverId)
data = despotify_get_image(m_session, const_cast<char *>(coverId.data()), &len);
}
+ QImage img = data != 0 ? QImage::fromData(static_cast<const uchar *>(data), len, "JPEG") : QImage();
free(data);
- QImage img = data != 0 ? QImage::fromData(static_cast<const uchar *>(data), len, "JPEG") : QImage();
{
QMutexLocker locker(&m_coverCacheLock);
m_coverCache.insert(coverId, img);