Merge branch 'bilelmoussaoui/dmabuf-division-0' into 'main'

dmabuf: Avoid division by 0

See merge request GNOME/libmks!36
This commit is contained in:
Christian Hergert 2023-08-31 16:12:04 +00:00
commit 7a101fc4d7

View File

@ -98,7 +98,10 @@ mks_dmabuf_paintable_get_intrinsic_aspect_ratio (GdkPaintable *paintable)
{ {
MksDmabufPaintable *self = MKS_DMABUF_PAINTABLE (paintable); MksDmabufPaintable *self = MKS_DMABUF_PAINTABLE (paintable);
return (double)self->width / (double)self->height; if (self->height != 0)
return (double)self->width / (double)self->height;
else
return 0.;
} }
static void static void