diff options
author | Max Kellermann <max.kellermann@gmail.com> | 2017-12-04 10:49:04 +0100 |
---|---|---|
committer | Max Kellermann <max.kellermann@gmail.com> | 2017-12-04 10:50:48 +0100 |
commit | d6d7001bc0c608514e46b2a1a2ed341269d2f226 (patch) | |
tree | 7727dc031bdf8470d02db2ed4db449e92235ec39 | |
parent | e8950f1cf59a7e4e2a6474096a9e15e1b7f764dc (diff) | |
download | pesconvert-master.tar.gz |
Fixes crash bug found with the afl fuzzer.
Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
-rw-r--r-- | cairo.c | 3 | ||||
-rw-r--r-- | svg.c | 3 |
2 files changed, 6 insertions, 0 deletions
@@ -28,6 +28,9 @@ void output_cairo(struct pes *pes, const char *filename, int size, double densit struct stitch *stitch = block->stitch; int i; + if (!block->nr_stitches) + continue; + cairo_set_source_rgb(cr, c->r / 255.0, c->g / 255.0, c->b / 255.0); cairo_move_to(cr, X(stitch), Y(stitch)); @@ -14,6 +14,9 @@ void output_svg(struct pes *pes) pes->max_y - pes->min_y); for (struct pes_block *block = pes->blocks; block; block = block->next) { + if (!block->nr_stitches) + continue; + int i; printf("<path stroke=\"#%02x%02x%02x\" fill=\"none\" d=\"M %d %d", block->color->r, |