Port r17546 from Tremor; although pieces had made it over to libvorbis, a comprehensive
authorMonty <xiphmont@xiph.org>
Fri, 3 Feb 2012 20:51:27 +0000 (20:51 +0000)
committerMonty <xiphmont@xiph.org>
Fri, 3 Feb 2012 20:51:27 +0000 (20:51 +0000)
commit4936fd271fcad8b401adb0c735685b4fd0bf273f
tree4dc675c9ca6b0d776e7931a02f7dbb76b70814d4
parent70635b34bb995a534a3485758596fec7ed9bc7fd
Port r17546 from Tremor; although pieces had made it over to libvorbis, a comprehensive
port and verification was called for.  This patch provided some additional floor0
hardening:

  floor0 code could potentially use a book where the number of vals it
  needed to decode was not an integer number of dims wide.  This caused
  it to overflow the output vector as the termination condition was in
  the outer loop of vorbis_book_decodev_set.

  None of the various vorbis_book_decodeXXXX calls internally guard
  against this case either, but in every other use the calling code does
  properly guard (and avoids putting more checks in the tight inner
  decode loop).

  For floor0, move the checks into the inner loop as there's little
  penalty for doing so.

[an equivalent change was already in libvorbis, but I've
harmonized the code with tremor]

  For floor0, move the checks into the inner loop as there's little
  penalty for doing so.  Add commentary indicating where guarding is
  done for each call variant.

svn path=/trunk/vorbis/; revision=18183
lib/codebook.c
lib/floor0.c