mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 22:41:30 +03:00
ensure gtk thumbnail content has a minimum render width. (fix coverity 1109861)
This commit is contained in:
parent
b4f3eaf082
commit
ba3671d147
@ -70,11 +70,12 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap,
|
||||
dheight = cairo_image_surface_get_height(dsurface);
|
||||
|
||||
/* Calculate size of buffer to render the content into */
|
||||
/* We get the width from the content width, unless it exceeds 1024,
|
||||
/* Get the width from the content width, unless it exceeds 1024,
|
||||
* in which case we use 1024. This means we never create excessively
|
||||
* large render buffers for huge contents, which would eat memory and
|
||||
* cripple performance. */
|
||||
cwidth = min(content_get_width(content), 1024);
|
||||
* cripple performance.
|
||||
*/
|
||||
cwidth = min(max(content_get_width(content), dwidth), 1024);
|
||||
|
||||
/* The height is set in proportion with the width, according to the
|
||||
* aspect ratio of the required thumbnail. */
|
||||
|
Loading…
Reference in New Issue
Block a user