aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2010-08-03 00:27:54 +0000
committerAlex Converse <alex.converse@gmail.com>2010-08-03 00:27:54 +0000
commit55aa55f2e16a052015df70bdff66067500c8e56d (patch)
treedefade985a0ef4f67e5c4c5e9ae14df6ab8c59bb
parent366d919016a679d3955f6fe5278fa7ce4f47b81e (diff)
downloadffmpeg-55aa55f2e16a052015df70bdff66067500c8e56d.tar.gz
vorbisdec: Return AVERROR(ENOMEM) on malloc() failure.
This is especially important because classifs can be very large. Originally committed as revision 24676 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/vorbis_dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c
index b543f5c8c7..19f7e1ebdc 100644
--- a/libavcodec/vorbis_dec.c
+++ b/libavcodec/vorbis_dec.c
@@ -667,6 +667,8 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
res_setup->classifs = av_malloc(res_setup->ptns_to_read *
vc->audio_channels *
sizeof(*res_setup->classifs));
+ if (!res_setup->classifs)
+ return AVERROR(ENOMEM);
AV_DEBUG(" begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size,
res_setup->classifications, res_setup->classbook);