Opened 15 years ago

Closed 15 years ago

Last modified 5 years ago

#4126 closed defect (outdated)

aspect ratio correction garbage pixels in recent snapshot

Reported by: SF/ewelsh42 Owned by: fingolfin
Priority: normal Component: Graphics
Version: Keywords:
Cc: Game:

Description

Builds from a recent snapshot (January 26th, 2009) exhibit garbage pixels when aspect ratio correction is enabled, independent of which filter is used. The error was traced back to a (recent?) change in graphics/scaler/intern.h

The interpolate32_1_1() function was overoptimized to save a bit shift. ((A>>1) + (B>>1)) had been replaced with ((A + B) >> 1). Unfortunately, adding A + B prior to downshifting can result in a uint32 overflow, resulting in garbage pixel colors.

Reverting to the previous non-overflowing version fixes the problem. Diff attached.

Ticket imported from: #2542162. Ticket imported from: bugs/4126.

Attachments (1)

intern.h.diff (434 bytes ) - added by SF/ewelsh42 15 years ago.
fix uint32 overflow in interpolate32_1_1()

Download all attachments as: .zip

Change History (7)

by SF/ewelsh42, 15 years ago

Attachment: intern.h.diff added

fix uint32 overflow in interpolate32_1_1()

comment:1 by wjp, 15 years ago

Thank you for the report. It looks like this was already fixed the 27th, however. Could you confirm it works in current SVN?

comment:2 by wjp, 15 years ago

Resolution: outdated
Status: newpending

comment:3 by SF/ewelsh42, 15 years ago

Status: pendingnew

comment:4 by SF/ewelsh42, 15 years ago

Confirmed. Fixed in current SVN. Thanks.

comment:5 by fingolfin, 15 years ago

Owner: set to fingolfin
Status: newclosed

comment:6 by digitall, 5 years ago

Component: --Unset--Graphics
Note: See TracTickets for help on using tickets.