changeset 32366:3a6a61ffbb34

Add fallback values to aspect_save_screenres to avoid division by 0 if screen dimensions are not known.
author reimar
date Sat, 09 Oct 2010 01:31:52 +0000
parents 5ce38803316e
children 4a890f542e69
files libvo/aspect.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/aspect.c	Fri Oct 08 09:00:50 2010 +0000
+++ b/libvo/aspect.c	Sat Oct 09 01:31:52 2010 +0000
@@ -71,6 +71,13 @@
 #ifdef ASPECT_DEBUG
   printf("aspect_save_screenres %dx%d \n",scrw,scrh);
 #endif
+  if (!scrw && !scrh) {
+    scrw = 1024;
+    scrh = 768;
+  } else if (scrw) {
+    scrh = (scrw * 3 + 3) / 4;
+  } else
+    scrw = (scrh * 4 + 2) / 3;
   aspdat.scrw = scrw;
   aspdat.scrh = scrh;
   if (force_monitor_aspect)