From: Mikko Rapeli Date: Fri, 10 Aug 2012 12:17:08 +0000 (+0200) Subject: dvdwizardvob.cpp: check return value X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0a5febf38abac4331ba87a7a8d704124ad7db9c5;p=kdenlive dvdwizardvob.cpp: check return value Fixes Coverity CID 709275: Unchecked return value (CHECKED_RETURN) Calling function "QDomDocument::setContent(QIODevice *, QString *, int *, int *)" without checking return value (as is done elsewhere 6 out of 7 times). No check of the return value of "doc.setContent(&file, NULL, NULL, NULL)". 134 doc.setContent(&file); --- diff --git a/src/dvdwizardvob.cpp b/src/dvdwizardvob.cpp index ebc4b844..1caae7f8 100644 --- a/src/dvdwizardvob.cpp +++ b/src/dvdwizardvob.cpp @@ -131,7 +131,10 @@ void DvdWizardVob::slotAddVobFile(KUrl url, const QString &chapters) QFile file(url.path() + ".dvdchapter"); if (file.open(QIODevice::ReadOnly)) { QDomDocument doc; - doc.setContent(&file); + if (doc.setContent(&file) == false) { + file.close(); + return; + } file.close(); QDomNodeList chapters = doc.elementsByTagName("chapter"); QStringList chaptersList;