diff options
author | Oneric <oneric@oneric.stub> | 2022-04-11 21:25:04 +0200 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2022-04-13 00:05:45 +0200 |
commit | 6678a517f8fc839dbe17c0846c5368c4327aef5b (patch) | |
tree | b794c5a38ebcdebb7c7f94c7aefd651c4d82141a | |
parent | c5ee66dfb4b10c3c499aa804c6d1abb195c696e1 (diff) | |
download | libass-6678a517f8fc839dbe17c0846c5368c4327aef5b.tar.bz2 libass-6678a517f8fc839dbe17c0846c5368c4327aef5b.tar.xz |
rasterizer: fix pointer arithmetic in assert
path->points can be NULL and any pointer arithmetic
on NULL, even NULL + 0, is undefined behaviour.
The rest of the function should be safe with NULL.
Found by AFL++ and UBSAN.
-rw-r--r-- | libass/ass_rasterizer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libass/ass_rasterizer.c b/libass/ass_rasterizer.c index 0ae9e56..36d7883 100644 --- a/libass/ass_rasterizer.c +++ b/libass/ass_rasterizer.c @@ -314,7 +314,7 @@ bool rasterizer_set_outline(RasterizerData *rst, return false; } } - assert(start == cur && cur == path->points + path->n_points); + assert(start == cur && (!cur || cur == path->points + path->n_points)); for (size_t k = rst->n_first; k < rst->size[0]; k++) { struct segment *line = &rst->linebuf[0][k]; |