aac_parser: add required padding for GetBitContext buffer

Message ID 20150609090110.6D0E35DD50@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau June 9, 2015, 9:01 a.m.
Module: libav
Branch: master
Commit: fb1473080223a634b8ac2cca48a632d037a0a69d

Author:    Janne Grunau <janne-libav@jannau.net>
Committer: Janne Grunau <janne-libav@jannau.net>
Date:      Mon Jun  8 14:45:12 2015 +0200

aac_parser: add required padding for GetBitContext buffer

Fixes stack buffer overflow errors detected by address sanitizer in
various fate tests.

CC: libav-stable@libav.org

---

 libavcodec/aac_parser.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c
index fdaa5f8..acb05d4 100644
--- a/libavcodec/aac_parser.c
+++ b/libavcodec/aac_parser.c
@@ -34,7 +34,7 @@  static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
     int size;
     union {
         uint64_t u64;
-        uint8_t  u8[8];
+        uint8_t  u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
     } tmp;
 
     tmp.u64 = av_be2ne64(state);