mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 17:23:09 +03:00
Test for zero width/height at the start.
This commit is contained in:
parent
37d148f4d7
commit
4357f5e9d7
@ -404,6 +404,11 @@ static bool nsgtk_plot_bitmap(int x, int y, int width, int height,
|
||||
bool repeat_x = (flags & BITMAPF_REPEAT_X);
|
||||
bool repeat_y = (flags & BITMAPF_REPEAT_Y);
|
||||
|
||||
/* Bail early if we can */
|
||||
if (width == 0 || height == 0)
|
||||
/* Nothing to plot */
|
||||
return true;
|
||||
|
||||
if (!(repeat_x || repeat_y)) {
|
||||
/* Not repeating at all, so just pass it on */
|
||||
return nsgtk_plot_pixbuf(x, y, width, height, bitmap, bg);
|
||||
@ -412,11 +417,6 @@ static bool nsgtk_plot_bitmap(int x, int y, int width, int height,
|
||||
width = bitmap_get_width(bitmap);
|
||||
height = bitmap_get_height(bitmap);
|
||||
|
||||
/* Bail early if we can */
|
||||
if (width == 0 || height == 0)
|
||||
/* Nothing to plot */
|
||||
return true;
|
||||
|
||||
if (y > cliprect.y) {
|
||||
doneheight = (cliprect.y - height) + ((y - cliprect.y) % height);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user