Browse Source

avformat/utils: Print warning if reallocating probe buffer failed

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
e960b3e27e
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavformat/utils.c

+ 5
- 1
libavformat/utils.c View File

@@ -589,8 +589,12 @@ static int probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)


if (pkt) { if (pkt) {
uint8_t *new_buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE); uint8_t *new_buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);
if(!new_buf)
if(!new_buf) {
av_log(s, AV_LOG_WARNING,
"Failed to reallocate probe buffer for stream %d\n",
st->index);
goto no_packet; goto no_packet;
}
pd->buf = new_buf; pd->buf = new_buf;
memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size); memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
pd->buf_size += pkt->size; pd->buf_size += pkt->size;


Loading…
Cancel
Save