Ticket #4126: intern.h.diff

File intern.h.diff, 434 bytes (added by SF/ewelsh42, 16 years ago)

fix uint32 overflow in interpolate32_1_1()

  • graphics/scaler/intern.h

    old new  
    4545 */
    4646template<int bitFormat>
    4747static inline uint32 interpolate32_1_1(uint32 A, uint32 B) {
    48         return (((A & kHighBitsMask) + (B & kHighBitsMask)) >> 1) + (A & B & kLowBitsMask);
     48        return (((A & kHighBitsMask) >> 1) + ((B & kHighBitsMask) >> 1) + (A & B & kLowBitsMask));
    4949}
    5050
    5151/**