Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
libcaca.10050
libcaca-prevent-overflow.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libcaca-prevent-overflow.patch of Package libcaca.10050
Author: Josef Möllers <jmoellers@suse.de> Index: libcaca-da28e9684ef445ac8d42745644336b8a75c01855/caca/dither.c =================================================================== --- libcaca-da28e9684ef445ac8d42745644336b8a75c01855.orig/caca/dither.c +++ libcaca-da28e9684ef445ac8d42745644336b8a75c01855/caca/dither.c @@ -116,7 +116,7 @@ enum color_mode struct caca_dither { int bpp, has_palette, has_alpha; - int w, h, pitch; + size_t w, h, pitch; int rmask, gmask, bmask, amask; int rright, gright, bright, aright; int rleft, gleft, bleft, aleft; @@ -991,10 +991,10 @@ int caca_dither_bitmap(caca_canvas_t *cv /* First get RGB */ if(d->antialias) { - fromx = (x - x1) * w / deltax; - fromy = (y - y1) * h / deltay; - tox = (x - x1 + 1) * w / deltax; - toy = (y - y1 + 1) * h / deltay; + fromx = (uint64_t)(x - x1) * w / deltax; + fromy = (uint64_t)(y - y1) * h / deltay; + tox = (uint64_t)(x - x1 + 1) * w / deltax; + toy = (uint64_t)(y - y1 + 1) * h / deltay; /* We want at least one pixel */ if(tox == fromx) tox++; @@ -1017,10 +1017,10 @@ int caca_dither_bitmap(caca_canvas_t *cv } else { - fromx = (x - x1) * w / deltax; - fromy = (y - y1) * h / deltay; - tox = (x - x1 + 1) * w / deltax; - toy = (y - y1 + 1) * h / deltay; + fromx = (uint64_t)(x - x1) * w / deltax; + fromy = (uint64_t)(y - y1) * h / deltay; + tox = (uint64_t)(x - x1 + 1) * w / deltax; + toy = (uint64_t)(y - y1 + 1) * h / deltay; /* tox and toy can overflow the canvas, but they cannot overflow * when averaged with fromx and fromy because these are guaranteed Index: libcaca-da28e9684ef445ac8d42745644336b8a75c01855/src/common-image.h =================================================================== --- libcaca-da28e9684ef445ac8d42745644336b8a75c01855.orig/src/common-image.h +++ libcaca-da28e9684ef445ac8d42745644336b8a75c01855/src/common-image.h @@ -13,7 +13,7 @@ struct image { char *pixels; - unsigned int w, h; + size_t w, h; struct caca_dither *dither; void *priv; };
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor