summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2010-05-21 20:23:22 +0000
committerReinhard Tartler <siretart@tauware.de>2010-05-21 20:23:22 +0000
commite6ef35bc22681895983ce28809dd6b2544cfb5a8 (patch)
treedf388f835fbd19b5becfe0d0e46aa8604cdd0db0 /libavcodec
parent3588e6b7c5327eb0831d1b0fc4baf2ce96566b98 (diff)
Make aac_decode_frame() consume zero padding at the end of a packet.
backport r23195 by alexc Originally committed as revision 23229 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aac.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/aac.c b/libavcodec/aac.c
index ac8c9c6ec4..3330e1cefe 100644
--- a/libavcodec/aac.c
+++ b/libavcodec/aac.c
@@ -1954,6 +1954,7 @@ static int aac_decode_frame(AVCodecContext *avccontext, void *data,
int err, elem_id, data_size_tmp;
int buf_consumed;
int samples = 1024, multiplier;
+ int buf_offset;
init_get_bits(&gb, buf, buf_size * 8);
@@ -2065,7 +2066,11 @@ static int aac_decode_frame(AVCodecContext *avccontext, void *data,
ac->output_configured = OC_LOCKED;
buf_consumed = (get_bits_count(&gb) + 7) >> 3;
- return buf_size > buf_consumed ? buf_consumed : buf_size;
+ for (buf_offset = buf_consumed; buf_offset < buf_size; buf_offset++)
+ if (buf[buf_offset])
+ break;
+
+ return buf_size > buf_offset ? buf_consumed : buf_size;
}
static av_cold int aac_decode_close(AVCodecContext *avccontext)