mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 04:22:05 +00:00
Bug 1043 - COGL calls glTexSubImage2D() with out-of-bounds
values (SIGSEGV) * clutter/cogl/gl/cogl-texture.c (_cogl_texture_upload_subregion_to_gl): When iterating over the slices, discard ones that don't intersect immediatly otherwise it will call glTexSubImage2D with a negative width/height and then move the source position incorrectly. Thanks to Gwenole Beauchesne.
This commit is contained in:
parent
238e9c3a1a
commit
ae1a4a6a30
@ -395,6 +395,13 @@ _cogl_texture_upload_subregion_to_gl (CoglTexture *tex,
|
||||
_cogl_span_iter_next (&y_iter),
|
||||
source_y += inter_h )
|
||||
{
|
||||
/* Discard slices out of the subregion early */
|
||||
if (!y_iter.intersects)
|
||||
{
|
||||
inter_h = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Iterate horizontal spans */
|
||||
for (source_x = src_x,
|
||||
_cogl_span_iter_begin (&x_iter, tex->slice_x_spans,
|
||||
@ -406,6 +413,13 @@ _cogl_texture_upload_subregion_to_gl (CoglTexture *tex,
|
||||
_cogl_span_iter_next (&x_iter),
|
||||
source_x += inter_w )
|
||||
{
|
||||
/* Discard slices out of the subregion early */
|
||||
if (!x_iter.intersects)
|
||||
{
|
||||
inter_w = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Pick intersection width and height */
|
||||
inter_w = CLUTTER_FIXED_TO_INT (x_iter.intersect_end -
|
||||
x_iter.intersect_start);
|
||||
|
Loading…
Reference in New Issue
Block a user