Don't underrun the vertex array of empty polygons
authorOndřej Majerech <oxyd.oxyd@gmail.com>
Tue, 19 Aug 2014 13:59:45 +0000 (15:59 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 20 Aug 2014 08:43:26 +0000 (11:43 +0300)
commita64a475ede0a0114cff313acaa9e63a8fb180cfd
treefd1d88413c31fa3c3218a4f194d5b8a4f5ef74dd
parent06e089275d30a7803f6873cd55d1041356eb07ab
Don't underrun the vertex array of empty polygons

This silences the following warning:
  src/vertex-clipping.c:196:22: warning: array subscript is below array
  bounds [-Warray-bounds]
    ctx->prev.x = src->x[src->n - 1];

[Pekka Paalanen: the src->n < 2 comparison comes from the fact that a
polygon with 0 or 1 points is not a polygon. A polygon with 2 points is
still degenerate, but at least it has two edges that can be clipped.]

Signed-off-by: Ondřej Majerech <oxyd.oxyd@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
src/vertex-clipping.c