[FFmpeg-cvslog] aac: check the maximum number of channels
Luca Barbato
git at videolan.org
Sun May 12 14:16:45 CEST 2013
ffmpeg | branch: release/1.1 | Luca Barbato <lu_zero at gentoo.org> | Sat Apr 27 18:20:47 2013 +0200| [46fd6e4f2ebbcd5a00847cdb05fe416466d06d37] | committer: Luca Barbato
aac: check the maximum number of channels
Broken bitstreams could report a larger than specified number of
channels and cause outbound writes.
CC:libav-stable at libav.org
(cherry picked from commit a943a132f36f4df8fe2f749744677b71984abce7)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46fd6e4f2ebbcd5a00847cdb05fe416466d06d37
---
libavcodec/aacdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index d10a482..dec6d01 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -142,6 +142,8 @@ static av_cold int che_configure(AACContext *ac,
enum ChannelPosition che_pos,
int type, int id, int *channels)
{
+ if (*channels >= MAX_CHANNELS)
+ return AVERROR_INVALIDDATA;
if (che_pos) {
if (!ac->che[type][id]) {
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
More information about the ffmpeg-cvslog
mailing list