[libGD] #92 [Task opened] imagearc/imagefilledarc DoS fix problem

[email protected] (libGD) Tue, 12 Jun 2007 08:03:15 +0000
Newsgroups php.gd.bugs
Message-ID <[email protected]>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below.

User who did this - Claes MÃ¥nsson (cj)

Attached to Project - libGD
Summary - imagearc/imagefilledarc DoS fix problem
Task Type - Bug Report
Category - Drawing function
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Normal
Reported Version - 2.0.34
Due in Version - Undecided
Due Date - Undecided
Details - The DoS fix for imagearc and imagefilledarc ( http://bugs.libgd.org/?do=details&task_id=74 ) may be too pedantic when cropping angles.

Consider a start angle of 270 and an end angle of 630. The intent is clearly to draw a full revolution of the arc from 12 to 12 o clock, but the modulo arithmetic converts the end angle to 270 which means that nothing is drawn.

This new behaviour broke a piechart script that we were using, so the issue is not merely theoretical.

A fix may go along the lines of this (untested code):
<code>
int diff;

diff = e - s;

if (diff > 360) {
  diff = diff % 360;
}


if (s > 360) {
  s = s % 360;
}

e = s + diff;
</code>








More information can be found at the following URL:
http://bugs.libgd.org/?do=details&task_id=92

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.