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 commitc509f4f747
) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commitf43b6e2b1e
) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:

committed by
Reinhard Tartler

parent
e676bbb8cf
commit
f728ad26f0
@@ -395,6 +395,8 @@ static int decodeTonalComponents (GetBitContext *gb, tonal_component *pComponent
|
|||||||
|
|
||||||
for (k=0; k<coded_components; k++) {
|
for (k=0; k<coded_components; k++) {
|
||||||
sfIndx = get_bits(gb,6);
|
sfIndx = get_bits(gb,6);
|
||||||
|
if (component_count >= 64)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
pComponent[component_count].pos = j * 64 + (get_bits(gb,6));
|
pComponent[component_count].pos = j * 64 + (get_bits(gb,6));
|
||||||
max_coded_values = 1024 - pComponent[component_count].pos;
|
max_coded_values = 1024 - pComponent[component_count].pos;
|
||||||
coded_values = coded_values_per_component + 1;
|
coded_values = coded_values_per_component + 1;
|
||||||
|
Reference in New Issue
Block a user