Commit 9f0b9ae8 authored by Steven Liu's avatar Steven Liu

avformat/iff: fix memleak when get st->codecpar->extradata failed in iff_read_header

Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
parent 6f84c1e9
......@@ -529,8 +529,11 @@ static int iff_read_header(AVFormatContext *s)
st->codecpar->extradata = av_malloc(data_size + IFF_EXTRA_VIDEO_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
if (!st->codecpar->extradata)
return AVERROR(ENOMEM);
if (avio_read(pb, st->codecpar->extradata + IFF_EXTRA_VIDEO_SIZE, data_size) < 0)
if (avio_read(pb, st->codecpar->extradata + IFF_EXTRA_VIDEO_SIZE, data_size) < 0) {
av_freep(&st->codecpar->extradata);
st->codecpar->extradata_size = 0;
return AVERROR(EIO);
}
break;
case ID_BMHD:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment