Don't reuse file names
[harmattan/cameraplus] / lib / qtcamvideosettings.cpp
index f79b8b4..c05ec75 100644 (file)
@@ -1,7 +1,7 @@
 /*!
  * This file is part of CameraPlus.
  *
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -149,6 +149,11 @@ QString QtCamVideoSettings::profilePath() const {
 }
 
 QtCamVideoResolution QtCamVideoSettings::defaultResolution(const QString& aspectRatio) const {
+  if (d_ptr->resolutions.isEmpty()) {
+    return QtCamVideoResolution(QString(), QString(), QSize(), QSize(),
+                               -1, -1, QString(), QString());
+  }
+
   if (aspectRatio.isEmpty()) {
     return d_ptr->resolutions[0];
   }