mi: NULL-protect miFillGeneralPoly()
| In file included from ../mi/mipoly.c:59: | ../mi/mipoly.c: In function ‘miFillGeneralPoly’: | ../mi/mipoly.h:162:12: warning: dereference of NULL ‘pAET’ [CWE-476] [-Wanalyzer-null-dereference] | 162 | if (pAET->ymax == y) { /* leaving this edge */ \ | ../mi/mipoly.c:591:17: note: in expansion of macro ‘EVALUATEEDGEEVENODD’ | 591 | EVALUATEEDGEEVENODD(pAET, pPrevAET, y); | | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
fccc98645b
commit
3b9ca877a4
|
@ -587,8 +587,10 @@ miFillGeneralPoly(DrawablePtr dst, GCPtr pgc, int count, DDXPointPtr ptsIn)
|
||||||
width = FirstWidth;
|
width = FirstWidth;
|
||||||
nPts = 0;
|
nPts = 0;
|
||||||
}
|
}
|
||||||
EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
|
if (pAET != NULL) { // FIXME: somewhow analyzer still complains
|
||||||
EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
|
EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
|
||||||
|
EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
miInsertionSort(&AET);
|
miInsertionSort(&AET);
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,7 @@ typedef struct _ScanLineListBlock {
|
||||||
* The even-odd rule is in effect.
|
* The even-odd rule is in effect.
|
||||||
*/
|
*/
|
||||||
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
|
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
|
||||||
|
assert(pAET); \
|
||||||
if (pAET->ymax == y) { /* leaving this edge */ \
|
if (pAET->ymax == y) { /* leaving this edge */ \
|
||||||
pPrevAET->next = pAET->next; \
|
pPrevAET->next = pAET->next; \
|
||||||
pAET = pPrevAET->next; \
|
pAET = pPrevAET->next; \
|
||||||
|
|
Loading…
Reference in New Issue