ngl: Avoid a coordinate overflow
authorMatthias Clasen <mclasen@redhat.com>
Sat, 28 Aug 2021 19:42:30 +0000 (15:42 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 2 Sep 2021 23:59:41 +0000 (19:59 -0400)
This was showing up as big text selections going
missing sporadically.

Fixes: #4214
gsk/ngl/gsknglrenderjob.c

index 532157d1be9f3f564cc3e843a78fe7e75a0881e3..ef4d075997839b85ef30188af7197fe0af72928e 100644 (file)
@@ -1408,7 +1408,10 @@ gsk_ngl_render_job_visit_color_node (GskNglRenderJob     *job,
   program = CHOOSE_PROGRAM (job, coloring);
   batch = gsk_ngl_command_queue_get_batch (job->command_queue);
 
-  if (batch->any.kind == GSK_NGL_COMMAND_KIND_DRAW &&
+  /* Limit the size, or we end up with a coordinate overflow somwhere. */
+  if (node->bounds.size.width < 300 &&
+      node->bounds.size.height < 300 &&
+      batch->any.kind == GSK_NGL_COMMAND_KIND_DRAW &&
       batch->any.program == program->id)
     {
       GskNglRenderOffscreen offscreen = {0};