]> git.tuebingen.mpg.de Git - paraslash.git/commit
wma: Make bitstream API more robust.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 5 Jun 2017 14:52:37 +0000 (16:52 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 6 Jul 2017 19:00:36 +0000 (21:00 +0200)
commitac0008f1cb23e38c71b1074390ea530393cc8269
tree59ea9b0cee77bb93592a63d2221065beca9780eb
parent3e68ddfb40c68b5f2e13eff8aca9de14f7122a5f
wma: Make bitstream API more robust.

The ->buffer_end field of struct getbit_context is set but never
used. In fact, we never check bounds and happily read beyond the
supplied data buffer.

Fix this by replacing the field by ->num_bits, an integer which
is initialized in init_get_bits() to the number of bits available.
All functions which read the bitstream are modified to check bounds.
bitstream.h