Browse Source

gallium: fix trim() function bug when count < first

If the user called glDrawArrays(GL_TRIANGLES, count=1), trim() returned a
very large integer because of the unsigned arithmetic.
tags/mesa_20090313
Brian Paul 17 years ago
parent
commit
ba9e633902
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/gallium/auxiliary/draw/draw_pt.c

+ 2
- 0
src/gallium/auxiliary/draw/draw_pt.c View File

@@ -37,6 +37,8 @@

static unsigned trim( unsigned count, unsigned first, unsigned incr )
{
if (count < first)
return 0;
return count - (count - first) % incr;
}


Loading…
Cancel
Save