mirror of https://git.ffmpeg.org/ffmpeg.git
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
This commit is contained in:
parent
060b8592d2
commit
5ee05a62f9
5
ffmpeg.c
5
ffmpeg.c
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue