summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-17 03:18:58 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-17 03:18:58 +0100
commit9af6abdc17deb95c9b1f1d9242ba49b8b5e0b016 (patch)
treec687502cdeecf1b1c1a603e7943f52822c1f3a68 /libavcodec
parent552ec4c9fda480d61bff8447347b08f927f1fca3 (diff)
atrac3: Fix crash in tonal component decoding.
Fixes Ticket780 Bug Found by: cosminamironesei Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/atrac3.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index b9f1f516cc..fcf7c925eb 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;