Commit 5ee05a62 authored by Michael Niedermayer's avatar Michael Niedermayer

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
parent 060b8592
...@@ -728,6 +728,11 @@ static void do_audio_out(AVFormatContext *s, ...@@ -728,6 +728,11 @@ static void do_audio_out(AVFormatContext *s,
if (coded_bps) if (coded_bps)
size_out = size_out*coded_bps/8; 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() //FIXME pass ost->sync_opts as AVFrame.pts in avcodec_encode_audio()
ret = avcodec_encode_audio(enc, audio_out, size_out, ret = avcodec_encode_audio(enc, audio_out, size_out,
(short *)buftmp); (short *)buftmp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment