Commit 51f1bf33 authored by Paul B Mahol's avatar Paul B Mahol

bfi: check return value of av_malloc()

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent b791a083
...@@ -81,6 +81,8 @@ static int bfi_read_header(AVFormatContext * s) ...@@ -81,6 +81,8 @@ static int bfi_read_header(AVFormatContext * s)
/*Load the palette to extradata */ /*Load the palette to extradata */
avio_skip(pb, 8); avio_skip(pb, 8);
vstream->codec->extradata = av_malloc(768); vstream->codec->extradata = av_malloc(768);
if (!vstream->codec->extradata)
return AVERROR(ENOMEM);
vstream->codec->extradata_size = 768; vstream->codec->extradata_size = 768;
avio_read(pb, vstream->codec->extradata, avio_read(pb, vstream->codec->extradata,
vstream->codec->extradata_size); vstream->codec->extradata_size);
......
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