aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-09-13 17:03:56 -0300
committerJames Almer <jamrial@gmail.com>2017-09-13 17:22:00 -0300
commit7bae17e37ab63d1cfcea22c68c455f859db3663c (patch)
tree04121614ebc78a43313dcd9a30c1090b63455ad2
parent4d390344ec385f8eb7d46456df48cb07a0f946b0 (diff)
downloadffmpeg-7bae17e37ab63d1cfcea22c68c455f859db3663c.tar.gz
avcodec/extract_extradata: return an error when buffer allocation fails
ret is 0 by default. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/extract_extradata_bsf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c
index 4cd0ca1137..ed6509c681 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -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;
}