diff options
author | Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> | 2007-09-03 05:19:59 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2007-09-03 05:19:59 +0000 |
commit | 9be51815877cd48479c110a214f283dc4eff71e8 (patch) | |
tree | d78289fc90a8f4c1fa3e090ae2e8aa7a6ff86669 /libavformat | |
parent | da0b94f539a2dab7e150a419fa90b4d0d6ff9b84 (diff) | |
download | ffmpeg-9be51815877cd48479c110a214f283dc4eff71e8.tar.gz |
fix probe buffer issue. patch by Wolfram Gloger {wmglo at dent.med.uni-muenchen.de}.
[FFmpeg-devel] [PATCH] ac3_probe input buffer overrun
Aug 28, 2007
Originally committed as revision 10281 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index e71cb5a096..de11835ff3 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -445,6 +445,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, /* read probe data */ pd->buf= av_realloc(pd->buf, probe_size + AVPROBE_PADDING_SIZE); pd->buf_size = get_buffer(pb, pd->buf, probe_size); + memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE); if (url_fseek(pb, 0, SEEK_SET) < 0) { url_fclose(pb); if (url_fopen(pb, filename, URL_RDONLY) < 0) { @@ -1866,9 +1867,10 @@ int av_find_stream_info(AVFormatContext *ic) if (st->codec->codec_id == CODEC_ID_NONE) { AVProbeData *pd = &(probe_data[st->index]); - pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size); + pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE); memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size); pd->buf_size += pkt->size; + memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE); } } if(st->parser && st->parser->parser->split && !st->codec->extradata){ |