diff --git a/src/lib/internal.h b/src/lib/internal.h index 856c0578f..f9c5099e7 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -944,7 +944,7 @@ clamp_to_sixelmax(const tinfo* t, int* y, int* x, int* outy, ncscale_e scaling){ *outy = *y; if(*outy % t->sprixel_scale_height){ *outy += t->sprixel_scale_height - (*outy % t->sprixel_scale_height); - while(*outy > t->sixel_maxy){ + while(t->sixel_maxy && *outy > t->sixel_maxy){ *outy -= t->sprixel_scale_height; } if(scaling == NCSCALE_STRETCH || *y > *outy){