Opened 12 years ago

Closed 12 years ago

#602 closed defect (fixed)

Division by small number leads to WP overflow

Reported by: fbossen Owned by:
Priority: minor Milestone: HM-7.2
Component: HM Version: HM-7.1
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…


In line 230 of WeighPredAnalysis.cpp, iRefAC may be small, leading to a large value of dWeight:

Double dWeight = (iRefAC==0) ? (Double)1.0 : ( (Double)(iCurrAC) / (Double)iRefAC);

dWeight should be clipped to an appropriate range

Attachments (1)

Bugifx_Ticket602.patch (1.5 KB) - added by Tanizawa 12 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 12 years ago by DefaultCC Plugin

  • Cc fbossen ksuehring davidf jct-vc@… added

comment:2 Changed 12 years ago by Tanizawa

Since the worst case of actual weighting factor should be in the range of -256.0 to 255.0 when Log2Denom is 0,
The straightforward solution is to clip the range of -256.0 to 255.0.
The patch to fix this issue was provided.

The original code:
Double dWeight = (iRefAC==0) ? (Double)1.0 : ( (Double)(iCurrAC) / (Double)iRefAC);

The modified code:
Double dWeight = (iRefAC==0) ? (Double)1.0 : Clip3( -256.0, 255.0, ((Double)iCurrAC / (Double)iRefAC) );

Changed 12 years ago by Tanizawa

comment:3 Changed 12 years ago by fbossen

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r2504

Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • David Flynn(Subscriber)
  • Frank Bossen(Reporter, Subscriber, Participant)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Always)