Bug 167843 - gd may crash whan drawing antialiased line near image borders
Summary: gd may crash whan drawing antialiased line near image borders
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gd
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-09-08 20:17 UTC by Nikita Shulga
Modified: 2015-03-05 01:15 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-10 13:57:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Following patch will fix the problem mentioned (606 bytes, patch)
2005-09-08 20:19 UTC, Nikita Shulga
no flags Details | Diff

Description Nikita Shulga 2005-09-08 20:17:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ru-ru) AppleWebKit/412.7 (KHTML, like Gecko) Safari/412.5

Description of problem:
If one will try to draw antialiased line parallel to horizontal or vertical border - GD will try to put pixel 
outside of picture limits, which in majority of cases will lead to segfault.

Version-Release number of selected component (if applicable):
gd-2.0.33-2

How reproducible:
Always

Steps to Reproduce:
1. Compile following program:
#include <gd.h>
int main(void) {
        gdImage *img = gdImageCreateTrueColor(640,480);
        gdImageAlphaBlending(img, 1);
        gdImageSetAntiAliased(img, 1); 
        gdImageLine(img, 202, 479, 198, 479, -7);
}

2. Run it
  

Actual Results:  segfault

Expected Results:  no segfault

Additional info:

Comment 1 Nikita Shulga 2005-09-08 20:19:35 UTC
Created attachment 118608 [details]
Following patch will fix the problem mentioned

At the very begining of gdImageSetAAPixel color function checks that action are
performed within picture limits

Comment 2 Phil Knirsch 2005-10-10 13:57:27 UTC
Looks good, will be included in next gd build for development.

Read ya, Phil


Note You need to log in before you can comment on or make changes to this bug.