bsf: check memory allocations

This commit is contained in:
Vittorio Giovara
2014-12-18 20:26:56 +01:00
parent 014b6b416f
commit 8a9641a652
7 changed files with 24 additions and 3 deletions

View File

@@ -193,6 +193,8 @@ int av_parser_change(AVCodecParserContext *s, AVCodecContext *avctx,
*poutbuf_size = size;
*poutbuf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
memcpy(*poutbuf + avctx->extradata_size, buf,