Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
libcaca
Bug1120502-add_cast_to_prevent_overflow.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Bug1120502-add_cast_to_prevent_overflow.patch of Package libcaca
Author: Josef Möllers <jmoellers@suse.de> Index: libcaca-da28e9684ef445ac8d42745644336b8a75c01855/caca/dither.c =================================================================== --- libcaca-da28e9684ef445ac8d42745644336b8a75c01855.orig/caca/dither.c +++ libcaca-da28e9684ef445ac8d42745644336b8a75c01855/caca/dither.c @@ -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
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