Browse Source

riff: Fix potential memleak.

Make ff_get_wav_header() free existing extradata before allocing a new
buffer.
tags/n0.8
Alex Converse 14 years ago
parent
commit
ed8a50068c
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavformat/riff.c

+ 1
- 0
libavformat/riff.c View File

@@ -509,6 +509,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
}
codec->extradata_size = cbSize;
if (cbSize > 0) {
av_free(codec->extradata);
codec->extradata = av_mallocz(codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!codec->extradata)
return AVERROR(ENOMEM);


Loading…
Cancel
Save