[digikam] [Bug 378855] Crashes on startup

bugzilla_noreply at kde.org bugzilla_noreply at kde.org
Thu May 11 18:45:23 BST 2017


https://bugs.kde.org/show_bug.cgi?id=378855

--- Comment #6 from caulier.gilles at gmail.com ---
I see the problem. In 5.5.0 version the imagequerybuilder.cpp line 1142 is this
one :

    else if (name == QLatin1String("videoaudiobitrate"))
    {
        //fieldQuery.addIntField("VideoMetadata.audioBitRate");
        QList<int> values = reader.valueToIntList();

        if (values.size() != 2)
        {
            qCWarning(DIGIKAM_DATABASE_LOG) << "Relation Interval requires a
list of two values";
        }

        sql += QString::fromUtf8(" ( CAST(VideoMetadata.audioBitRate AS
INTEGER)");
        ImageQueryBuilder::addSqlRelation(sql,
                                          relation == SearchXml::Interval ?
SearchXml::GreaterThanOrEqual : SearchXml::GreaterThan);
        sql += QString::fromUtf8(" ? AND CAST(VideoMetadata.audioBitRate AS
INTEGER)");
        ImageQueryBuilder::addSqlRelation(sql,
                                          relation == SearchXml::Interval ?
SearchXml::LessThanOrEqual : SearchXml::LessThan);
        sql += QString::fromUtf8(" ?) ");

        *boundValues << values.first() << values.last(); <<<<<<<<<<<<<<<<<<<!!!
    }

In this source code, there are plenty of QList<> << v.first() << v.last()
operation. if v list is empty, due to the queries to encapsulate to XML, Qt
generate an exception and application crash.

So everywhere in this code, when this kind of operation is done, we need a
check to see if v list is empty or not.

Gilles Caulier

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Digikam-devel mailing list