]> git.sesse.net Git - kdenlive/commitdiff
dvdwizardvob.cpp: check return value
authorMikko Rapeli <mikko.rapeli@iki.fi>
Fri, 10 Aug 2012 12:17:08 +0000 (14:17 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 2 Sep 2012 09:40:49 +0000 (11:40 +0200)
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

index ebc4b8441340a3d79c8648ae2a4bb941fe37838f..1caae7f8180dbfd676da45abc180ee62cc17fdc9 100644 (file)
@@ -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;