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:
parent
dbd3183935
commit
ed8a50068c
@ -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…
Reference in New Issue
Block a user