# HG changeset patch # User jbr # Date 1188796799 0 # Node ID 70b45051aef6916fbd41fe9d12af8bd508b7127b # Parent 1a2f353ac291de8f3f0e6140ae11240b5e627c06 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 diff -r 1a2f353ac291 -r 70b45051aef6 utils.c --- a/utils.c Sun Sep 02 15:58:43 2007 +0000 +++ b/utils.c Mon Sep 03 05:19:59 2007 +0000 @@ -445,6 +445,7 @@ /* 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 @@ 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){