Bug 167843 - gd may crash whan drawing antialiased line near image borders
gd may crash whan drawing antialiased line near image borders
Product: Fedora
Classification: Fedora
Component: gd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Depends On:
  Show dependency treegraph
Reported: 2005-09-08 16:17 EDT by Nikita Shulga
Modified: 2015-03-04 20:15 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-10 09:57:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Nikita Shulga 2005-09-08 16:17:10 EDT
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):

How reproducible:

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 16:19:35 EDT
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 09:57:27 EDT
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.