From 55bf2bebc7c99dd9dfe4a78ab7ca50d32f87f401 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 4 Oct 2022 04:57:26 +0300 Subject: [PATCH] thumbnailers: check if the attached pictures frame pointer is null in audio thumbnailer fixes possible crash Signed-off-by: Ivailo Monev --- thumbnailers/audio/AudioThumbs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thumbnailers/audio/AudioThumbs.cpp b/thumbnailers/audio/AudioThumbs.cpp index bbe3f818..51b49184 100644 --- a/thumbnailers/audio/AudioThumbs.cpp +++ b/thumbnailers/audio/AudioThumbs.cpp @@ -56,7 +56,7 @@ ATCreator::ATCreator() { } -bool ATCreator::create ( const QString &path, int /*w*/, int /*h*/, QImage &img ) +bool ATCreator::create(const QString &path, int /*w*/, int /*h*/, QImage &img) { bool bRet = false; @@ -68,7 +68,7 @@ bool ATCreator::create ( const QString &path, int /*w*/, int /*h*/, QImage &img TagLib::ID3v2::FrameList fList = mp3Tag->frameList("APIC"); TagLib::ID3v2::AttachedPictureFrame *pic; pic = static_cast(fList.front()); - if (!pic->picture().isEmpty()) { + if (pic && !pic->picture().isEmpty()) { img.loadFromData(pic->picture().data(),pic->picture().size()); bRet = true; } -- 2.11.0