avcodec: fix aac/ac3 parser bitstream buffer size
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 21 Aug 2014 23:15:57 +0000 (01:15 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 30 Aug 2014 19:33:09 +0000 (21:33 +0200)
commitc58d7f9eb56abc4c90d98011c23a4a031077af4e
tree51038ddfd8d519b942062d9bbb7460ce8f3c527f
parent11a61dd0e2b51bdb610a80e322667c3284f6d761
avcodec: fix aac/ac3 parser bitstream buffer size

Buffers containing copies of the AAC and AC3 header bits were not padded
before parsing, violating init_get_bits() buffer padding requirement,
leading to potential buffer read overflows.
This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer
for parsing the header in each of aac_parser.c and ac3_parser.c.

Based on patch by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fccd85b9f30525f88692f53134eba41f1f2d90db)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/aac_parser.c
libavcodec/ac3_parser.c