Hi,

On Fri, Jun 10, 2011 at 10:17:42AM +0200, walter harms wrote:
> Am 09.06.2011 21:57, schrieb Daniel Stone:
> > From: Derek Foreman <[email protected]>
> > 
> > Use a smarter motion estimator that attempts to draw a best-fit line
> > through the history where possible, including taking acceleration into
> > account.
> > 
> > Signed-off-by: Derek Foreman <[email protected]>
> > Reviewed-by: Daniel Stone <[email protected]>
> > ---
> 
> 
> I guess the buffer is priv->move_hist[SYNAPTICS_MOVE_HISTORY].
> Then you will get an off-by-one.
> 
> Depending on your overflow strategie:
> 
> either (priv->count_packet_finger < SYNAPTICS_MOVE_HISTORY-1)
> or
>       priv->count_packet_finger++;
>       priv->count_packet_finger %= SYNAPTICS_MOVE_HISTORY;

Hmm? No, count_packet_finger is only ever used as a counter of the
number of packets in the history, not as an index.  If you look at all
the usage, it's like this:

> > +    /* Determine the best fit line through the 3 most recent history 
> > entries */
> > +    for (i = 0; i < MIN(priv->count_packet_finger, 3); i++) {
> > +   ym += HIST(i).y;
> > +   xm += HIST(i).x;
> > +   tm += HIST_DELTA(i, 0, millis);
> > +    }

So I can't see how this would cause an overflow.

Cheers,
Daniel
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to