[Kdenlive-devel] [PATCH 07/16] dvdwizardvob.cpp: check return value
Mikko Rapeli
mikko.rapeli at iki.fi
Fri Aug 10 12:17:08 UTC 2012
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);
---
src/dvdwizardvob.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/dvdwizardvob.cpp b/src/dvdwizardvob.cpp
index ebc4b84..1caae7f 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;
--
1.7.10.4
More information about the Kdenlive
mailing list