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

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Tue Dec 2 18:56:46 PST 2008


YONETANI Tomokazu wrote:
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...
I believe that the mixer ioctls check for overflow.  Otherwise this is a bug.

cheers
  simon
--
  <3 the future  +++  RENT this banner advert  +++   ASCII Ribbon   /"\
  rock the past  +++  space for low €€€ NOW!1  +++     Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \





More information about the Commits mailing list