Commit b98510de authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/ffmdec: cleanup on extradata memory allocation failure

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent fdf588d7
......@@ -379,8 +379,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
goto fail;
}
codecpar->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!codecpar->extradata)
return AVERROR(ENOMEM);
if (!codecpar->extradata) {
ret = AVERROR(ENOMEM);
goto fail;
}
codecpar->extradata_size = size;
avio_read(pb, codecpar->extradata, size);
}
......@@ -690,8 +692,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
goto fail;
}
codecpar->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!codecpar->extradata)
return AVERROR(ENOMEM);
if (!codecpar->extradata) {
ret = AVERROR(ENOMEM);
goto fail;
}
codecpar->extradata_size = size;
avio_read(pb, codecpar->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