From 8a8a5726cef8b8cb3c32e670fd200d49f3b04c28 Mon Sep 17 00:00:00 2001 From: neonloop Date: Sat, 28 Aug 2021 21:27:17 +0000 Subject: Fixes scaler selection when dimensions are not set yet --- README.md | 2 +- scale.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ff05cd4..e0cae71 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ git clone --recurse-submodules https://git.crowdedwood.com/picoarch To build picoarch itself, you need libSDL 1.2, libpng, and libasound. Different cores may need additional dependencies. -After that, `make` bulids picoarch and all supported cores into this directory. +After that, `make` builds picoarch and all supported cores into this directory. ### TrimUI instructions 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 */ -- cgit v1.2.3