diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-17 03:18:58 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-04-08 11:43:06 +0200 |
commit | 224025d852dcc42f752c0922fef7121808d1e42f (patch) | |
tree | cfcda5f7613c6436982fa71d3a014d0763a7adf2 | |
parent | a8f4db0acd9b588ba33e3b8c0c21feea5916cfd1 (diff) | |
download | ffmpeg-224025d852dcc42f752c0922fef7121808d1e42f.tar.gz |
atrac3: Fix crash in tonal component decoding.
Add a check to avoid writing past the end of the channel_unit.components[]
array.
Bug Found by: cosminamironesei
Fixes CVE-2012-0853
CC: libav-stable@libav.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
(cherry picked from commit c509f4f74713b035a06f79cb4d00e708f5226bc5)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit f43b6e2b1ed47a1254a5d44c700a7fad5e9784be)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit f728ad26f0ec87650d2986a892785c0e2b97d161)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/atrac3.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 5179c345cf..8452853d7b 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -393,6 +393,8 @@ static int decodeTonalComponents (GetBitContext *gb, tonal_component *pComponent for (k=0; k<coded_components; k++) { sfIndx = get_bits(gb,6); + if (component_count >= 64) + return AVERROR_INVALIDDATA; pComponent[component_count].pos = j * 64 + (get_bits(gb,6)); max_coded_values = 1024 - pComponent[component_count].pos; coded_values = coded_values_per_component + 1; |