diff options
author | Robin Burchell <robin.burchell@jollamobile.com> | 2013-12-03 22:36:02 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-04 11:42:57 +0100 |
commit | b857f611014b8723751be8bc0418399ac62103ec (patch) | |
tree | 2f538c789dbee0bb6da82aa043556ed92beab3b0 | |
parent | 5708dfcc80ac4eb029bab6af9b9fbee148da0786 (diff) | |
download | qtlocation-b857f611014b8723751be8bc0418399ac62103ec.tar.gz |
Fix a dangling pointer use
toLocal8Bit returns a temporary, so we must not keep a pointer to the data
inside it
Change-Id: I8fa4138c15acce0005e304b5206585fcd1a5e56b
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r-- | src/location/maps/qgeotilecache.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/location/maps/qgeotilecache.cpp b/src/location/maps/qgeotilecache.cpp index 70709ce5..9bd9c977 100644 --- a/src/location/maps/qgeotilecache.cpp +++ b/src/location/maps/qgeotilecache.cpp @@ -318,8 +318,7 @@ QSharedPointer<QGeoTileTexture> QGeoTileCache::get(const QGeoTileSpec &spec) file.close(); QPixmap pixmap; - const char *format = (parts.size() == 2 ? parts.at(1).toLocal8Bit().constData() : 0); - if (!pixmap.loadFromData(bytes, format)) { + if (!pixmap.loadFromData(bytes, (parts.size() == 2 ? parts.at(1).toLocal8Bit().constData() : 0))) { handleError(spec, QLatin1String("Problem with tile image")); return QSharedPointer<QGeoTileTexture>(0); } |