From 642bdfd2d79c5f13a63397d281ec8092dbf5b288 Mon Sep 17 00:00:00 2001 From: Andrei Alexeyev Date: Tue, 9 Jun 2020 03:18:40 +0300 Subject: [PATCH] portrait_render: make sure to not pass 0 as viewport width/height That would trip an assertion. May happen with the null renderer (e.g. replay verification mode), where the fake textures are always 1x1, or with bad sprite data. --- src/portrait.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/portrait.c b/src/portrait.c index 8bdea2ae..bf3506df 100644 --- a/src/portrait.c +++ b/src/portrait.c @@ -59,8 +59,8 @@ void portrait_render(Sprite *s_base, Sprite *s_face, Sprite *s_out) { IntRect itc = sprite_denormalized_int_tex_coords(s_base); - uint tex_w = itc.w; - uint tex_h = itc.h; + uint tex_w = imax(itc.w, 1); + uint tex_h = imax(itc.h, 1); uint spr_w = s_base->extent.w; uint spr_h = s_base->extent.h;