Commit 7bae17e3 authored by James Almer's avatar James Almer

avcodec/extract_extradata: return an error when buffer allocation fails

ret is 0 by default.
Reviewed-by: 's avatarMark Thompson <sw@jkqxz.net>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 4d390344
......@@ -101,14 +101,17 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
if (s->remove) {
filtered_buf = av_buffer_alloc(pkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!filtered_buf)
if (!filtered_buf) {
ret = AVERROR(ENOMEM);
goto fail;
}
filtered_data = filtered_buf->data;
}
extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!extradata) {
av_buffer_unref(&filtered_buf);
ret = AVERROR(ENOMEM);
goto fail;
}
......
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