1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

riff: Fix potential memleak.

Make ff_get_wav_header() free existing extradata before allocing a new
buffer.
This commit is contained in:
Alex Converse 2011-06-09 09:50:38 -07:00
parent dbd3183935
commit ed8a50068c

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);