aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-17 03:18:58 +0100
committerReinhard Tartler <siretart@tauware.de>2012-02-26 10:03:14 +0100
commitf43b6e2b1ed47a1254a5d44c700a7fad5e9784be (patch)
tree98d47a8e4ad525c5e1bc114ebd945b1ab2001d39
parent697a45d861b7cd6a96718383a44f41348487f844 (diff)
downloadffmpeg-f43b6e2b1ed47a1254a5d44c700a7fad5e9784be.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>
-rw-r--r--libavcodec/atrac3.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 6dec6a3abe..107c6ffeb0 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -402,6 +402,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 = SAMPLES_PER_FRAME - pComponent[component_count].pos;
coded_values = coded_values_per_component + 1;