diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2006-10-10 19:22:40 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2006-10-10 19:22:40 +0000 |
commit | 38168222ae965438704968a106cb08e6ab069145 (patch) | |
tree | f342398d0c03d28a003c8acee402bb955ab9f876 | |
parent | 02d756dfd4f0ca89fcf31a0c8b1ce86c739a5b2e (diff) | |
download | rockbox-38168222ae965438704968a106cb08e6ab069145.tar.gz rockbox-38168222ae965438704968a106cb08e6ab069145.zip |
AAC codec: Fix buffer overrun on high-bitrate files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11179 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/libfaad/bits.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/codecs/libfaad/bits.c b/apps/codecs/libfaad/bits.c index 65f451a8cb..a010e830ed 100644 --- a/apps/codecs/libfaad/bits.c +++ b/apps/codecs/libfaad/bits.c | |||
@@ -32,7 +32,10 @@ | |||
32 | #include <string.h> | 32 | #include <string.h> |
33 | #include "bits.h" | 33 | #include "bits.h" |
34 | 34 | ||
35 | uint8_t static_buffer[1024]; | 35 | /* Need to be large enough to fit the largest compressed sample in a file. |
36 | * Samples a little larger than 1 KB observed in a 256 kbps file. | ||
37 | */ | ||
38 | uint8_t static_buffer[2048]; | ||
36 | 39 | ||
37 | /* initialize buffer, call once before first getbits or showbits */ | 40 | /* initialize buffer, call once before first getbits or showbits */ |
38 | void faad_initbits(bitfile *ld, const void *_buffer, const uint32_t buffer_size) | 41 | void faad_initbits(bitfile *ld, const void *_buffer, const uint32_t buffer_size) |
@@ -75,6 +78,7 @@ void faad_initbits(bitfile *ld, const void *_buffer, const uint32_t buffer_size) | |||
75 | 78 | ||
76 | void faad_endbits(bitfile *ld) | 79 | void faad_endbits(bitfile *ld) |
77 | { | 80 | { |
81 | #if 0 | ||
78 | if (ld) | 82 | if (ld) |
79 | { | 83 | { |
80 | if (ld->buffer) | 84 | if (ld->buffer) |
@@ -83,6 +87,9 @@ void faad_endbits(bitfile *ld) | |||
83 | ld->buffer = NULL; | 87 | ld->buffer = NULL; |
84 | } | 88 | } |
85 | } | 89 | } |
90 | #else | ||
91 | (void) ld; | ||
92 | #endif | ||
86 | } | 93 | } |
87 | 94 | ||
88 | uint32_t faad_get_processed_bits(bitfile *ld) | 95 | uint32_t faad_get_processed_bits(bitfile *ld) |