Skip to content
Snippets Groups Projects
Commit 7c8af53f authored by Måns Rullgård's avatar Måns Rullgård
Browse files

AAC: escape_sequence is 21 bits max

The maximum length of escape_sequence is 21 bits, so adjust limit in
code to match this.  Also fix the comment.

Originally committed as revision 21151 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5d629b72
No related branches found
No related tags found
No related merge requests found
...@@ -942,9 +942,9 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024], ...@@ -942,9 +942,9 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
if (vq_ptr[j] == 64.0f) { if (vq_ptr[j] == 64.0f) {
int n = 4; int n = 4;
/* The total length of escape_sequence must be < 22 bits according /* The total length of escape_sequence must be < 22 bits according
to the specification (i.e. max is 11111111110xxxxxxxxxx). */ to the specification (i.e. max is 111111110xxxxxxxxxxxx). */
while (get_bits1(gb) && n < 15) n++; while (get_bits1(gb) && n < 13) n++;
if (n == 15) { if (n == 13) {
av_log(ac->avccontext, AV_LOG_ERROR, "error in spectral data, ESC overflow\n"); av_log(ac->avccontext, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
return -1; return -1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment