[FFmpeg-cvslog] r24676 - trunk/libavcodec/vorbis_dec.c

alexc subversion
Tue Aug 3 02:27:54 CEST 2010


Author: alexc
Date: Tue Aug  3 02:27:54 2010
New Revision: 24676

Log:
vorbisdec: Return AVERROR(ENOMEM) on malloc() failure.

This is especially important because classifs can be very large.

Modified:
   trunk/libavcodec/vorbis_dec.c

Modified: trunk/libavcodec/vorbis_dec.c
==============================================================================
--- trunk/libavcodec/vorbis_dec.c	Tue Aug  3 02:25:06 2010	(r24675)
+++ trunk/libavcodec/vorbis_dec.c	Tue Aug  3 02:27:54 2010	(r24676)
@@ -667,6 +667,8 @@ static int vorbis_parse_setup_hdr_residu
         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);



More information about the ffmpeg-cvslog mailing list