Summary: | Divide by zero in intersect() | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Kamil Frankowicz <kamil.frankowicz> |
Component: | Graphics Library | Assignee: | Robin Watts <robin.watts> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | omarandemad, robin.watts |
Priority: | P1 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: | POC to trigger FPE (gs) |
Description
Kamil Frankowicz
2016-12-23 02:00:43 UTC
Its a scan-conversion problem, probably related to an overflow of the fixed point arithmetic (maybe). Unfortunately I can only reproduce this in a 64-bit Linux release build. Debug build on Linux and all Windows builds seem to work. Assigning to Robin as a scan-conversion bug for more investigation. I can reproduce this bug on 64bit linux in a debug build if I build using: make debug XCFLAGS="-O2" gdb --args debugbin/gs -dNOPAUSE -sDEVICE=bit -sOUTPUTFILE=/dev/null -dSAFER ~/Downloads/gs_fpe_intersect -c quit Note, that it should be -sOutputFile, as these options are case sensitive. I haven't checked to see if this matters. Fixed in: commit 4bef1a1d32e29b68855616020dbff574b9cda08f Author: Robin Watts <Robin.Watts@artifex.com> Date: Thu Dec 29 15:57:43 2016 +0000 Bug 697453: Avoid divide by 0 in scan conversion code. Arithmetic overflow due to extreme values in the scan conversion code can cause a division by 0. Avoid this with a simple extra check. dx_old=cf814d81 endp->x_next=b0e859b9 alp->x_next=8069a73a leads to dx_den = 0 |