aboutsummaryrefslogtreecommitdiff
path: root/scale.c
diff options
context:
space:
mode:
authorneonloop2021-08-28 21:27:17 +0000
committerneonloop2021-08-28 21:27:17 +0000
commit8a8a5726cef8b8cb3c32e670fd200d49f3b04c28 (patch)
treee6392a4bef11d0faaaacf0d61aa817091318b62b /scale.c
parent30f2aed06e01c6eb1e3c6ebb1b5002e67d754747 (diff)
downloadpicoarch-8a8a5726cef8b8cb3c32e670fd200d49f3b04c28.tar.gz
picoarch-8a8a5726cef8b8cb3c32e670fd200d49f3b04c28.tar.bz2
picoarch-8a8a5726cef8b8cb3c32e670fd200d49f3b04c28.zip
Fixes scaler selection when dimensions are not set yet
Diffstat (limited to 'scale.c')
-rw-r--r--scale.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/scale.c b/scale.c
index acf03e3..3c6265e 100644
--- a/scale.c
+++ b/scale.c
@@ -392,6 +392,7 @@ static void scale_sharp_256xXXX_320xXXX(unsigned w, unsigned h, size_t pitch, co
static void scale_select_scaler(unsigned w, unsigned h, size_t pitch) {
double current_aspect_ratio = aspect_ratio > 0 ? aspect_ratio : ((double)w / (double)h);
+ if (w == 0 || h == 0 || pitch == 0) return;
/* mame2000 sets resolutions / aspect ratio without notifying
* of changes, new should always override old */