aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-12-08 14:18:15 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-12-08 14:18:15 +0000
commit5ee05a62f968ef62198188d5c4ac68a1d20fc32d (patch)
treea847a8919985bd6615451104767fb5ad9c1b09f7
parent060b8592d2ddb92285406617cc689b08793d9c33 (diff)
downloadffmpeg-5ee05a62f968ef62198188d5c4ac68a1d20fc32d.tar.gz
Check that the buffer size speified to avcodec_encode_audio() is not larger than the actual size.
Originally committed as revision 20767 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 03231c7bd0..9de9c3f571 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -728,6 +728,11 @@ static void do_audio_out(AVFormatContext *s,
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);