aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/parser.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-12-18 20:26:56 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-01-15 01:25:16 +0100
commit8a9641a652ed1546fedfda22584f79d3d423096e (patch)
treec5f13c56aaadf20cece2188e509b430f6ea3061b /libavcodec/parser.c
parent014b6b416fec89777cb9cff61bcf7896eaf7cf39 (diff)
downloadffmpeg-8a9641a652ed1546fedfda22584f79d3d423096e.tar.gz
bsf: check memory allocations
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r--libavcodec/parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 6d20516f28..0a5c2cae33 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -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,