DragonFly commits List (threaded) for 2008-12
DragonFly BSD
DragonFly commits List (threaded) for 2008-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: master: sys/dev/sound/pcm/vchan.c cb8ff21ad49e7a92c572b31c6e26ad74d0feed5f


From: YONETANI Tomokazu <qhwt+dfly@xxxxxxxxxx>
Date: Wed, 3 Dec 2008 11:45:44 +0900

On Mon, Dec 01, 2008 at 03:59:30PM -0800, Simon Schubert wrote:
> http://gitweb.dragonflybsd.org/?p=dragonfly.git;a=commitdiff;h=cb8ff21ad49e7a92c572b31c6e26ad74d0feed5f

  -       scale = (volume << 16) / 100;
  +       scale = log_mix_cvt[volume];

I don't see how it's guaranteed that (volume < countof(log_mix_cvt) - 1).
The comment above that says `volume is in range 0-100', which is only
satisfied when (ch->volume & 0xff) + ((ch->volume >> 8) & 0xff) <= 200,
but I see no such check in the code under /sys/dev/sound...

Cheers.



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]