Skip to content

Commit

Permalink
Free extradata before reallocating.
Browse files Browse the repository at this point in the history
Otherwise ff_alloc_extradata() just leaks any existing allocated
memory.

Signed-off-by: Dale Curtis <[email protected]>
Reviewed-by: Derek Buitenhuis <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
dalecurtis authored and michaelni committed Nov 28, 2017
1 parent b3cb9bd commit 96e3407
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libavformat/oggparseogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ ogm_header(AVFormatContext *s, int idx)
size -= 52;
if (bytestream2_get_bytes_left(&p) < size)
return AVERROR_INVALIDDATA;
av_freep(&st->codecpar->extradata);
if (ff_alloc_extradata(st->codecpar, size) < 0)
return AVERROR(ENOMEM);
bytestream2_get_buffer(&p, st->codecpar->extradata, st->codecpar->extradata_size);
Expand Down

0 comments on commit 96e3407

Please sign in to comment.