aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-22 20:24:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-22 20:27:11 +0100
commitb7e7ee6231bc1f3608ed4005c3e7550ec4815296 (patch)
tree57b68c8556cc29970c99eb57078c66bb24fdc434
parent3518925a9127e368b6d0c7e8fd86510d34af40a1 (diff)
downloadffmpeg-b7e7ee6231bc1f3608ed4005c3e7550ec4815296.tar.gz
avfilter/buffer: Check for qp_table allocation failure
Fixes CID1271048 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/buffer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavfilter/buffer.c b/libavfilter/buffer.c
index 43dc66911a..a5b3b1dbaf 100644
--- a/libavfilter/buffer.c
+++ b/libavfilter/buffer.c
@@ -42,13 +42,19 @@ void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
av_free(ptr);
}
-static void copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {
+static int copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {
*dst = *src;
if (src->qp_table) {
int qsize = src->qp_table_size;
dst->qp_table = av_malloc(qsize);
+ if (!dst->qp_table) {
+ av_log(NULL, AV_LOG_ERROR, "Failed to allocate qp_table\n");
+ dst->qp_table_size = 0;
+ return AVERROR(ENOMEM);
+ }
memcpy(dst->qp_table, src->qp_table, qsize);
}
+ return 0;
}
AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)