about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2008-09-27 01:36:07 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2008-09-27 01:36:07 +0000
commitf04d41f61e5cf83835c6bc85122e65cfe2cf9857 (patch)
tree233761560b3b397cebc7b92426664230d59f487a /lib
parent85335f08b1fda7a6384f70e24c814cb533a9971e (diff)
downloadnetpbm-mirror-f04d41f61e5cf83835c6bc85122e65cfe2cf9857.tar.gz
netpbm-mirror-f04d41f61e5cf83835c6bc85122e65cfe2cf9857.tar.xz
netpbm-mirror-f04d41f61e5cf83835c6bc85122e65cfe2cf9857.zip
Release 10.43.06
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@734 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-rw-r--r--lib/libppmd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libppmd.c b/lib/libppmd.c
index 167d5c76..1046ce68 100644
--- a/lib/libppmd.c
+++ b/lib/libppmd.c
@@ -260,6 +260,14 @@ clipEnd0(int    const x0,
         }
     }
 
+    /* Clipping vertically may have moved the endpoint out of frame
+       horizontally.  If so, we know the other endpoint is also out of
+       frame horizontally and the line misses the frame entirely.
+    */
+    if (cx0 < 0 || cx0 >= cols) {
+        assert(x1 < 0 || x1 >= cols);
+        noLine = TRUE;
+    }
     *cx0P = cx0;
     *cy0P = cy0;
     *noLineP = noLine;