[FFmpeg-cvslog] r20767 - trunk/ffmpeg.c

michael subversion
Tue Dec 8 15:18:15 CET 2009


Author: michael
Date: Tue Dec  8 15:18:15 2009
New Revision: 20767

Log:
Check that the buffer size speified to avcodec_encode_audio() is not larger than the actual size.

Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Tue Dec  8 15:10:49 2009	(r20766)
+++ trunk/ffmpeg.c	Tue Dec  8 15:18:15 2009	(r20767)
@@ -728,6 +728,11 @@ static void do_audio_out(AVFormatContext
         if (coded_bps)
             size_out = size_out*coded_bps/8;
 
+        if(size_out > audio_out_size){
+            fprintf(stderr, "Internal error, buffer size too small\n");
+            av_exit(1);
+        }
+
         //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
         ret = avcodec_encode_audio(enc, audio_out, size_out,
                                    (short *)buftmp);



More information about the ffmpeg-cvslog mailing list