X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fbuffer.c;h=a5b3b1dbafc3fe8be62461984ac64bbb1a51b56b;hb=bf691e1d39560532344e6df2e72f522cea6c9bea;hp=43dc66911aeea9c28667ce888cba4dbd869db676;hpb=20f5a179560ce844c9fa7886f60d61d4e2db7480;p=ffmpeg diff --git a/libavfilter/buffer.c b/libavfilter/buffer.c index 43dc66911ae..a5b3b1dbafc 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)