mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-10-02 17:12:49 +02:00
avfilter/buffer: Check for qp_table allocation failure
Fixes CID1271048 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3518925a91
commit
b7e7ee6231
@ -42,13 +42,19 @@ void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
|
|||||||
av_free(ptr);
|
av_free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {
|
static int copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {
|
||||||
*dst = *src;
|
*dst = *src;
|
||||||
if (src->qp_table) {
|
if (src->qp_table) {
|
||||||
int qsize = src->qp_table_size;
|
int qsize = src->qp_table_size;
|
||||||
dst->qp_table = av_malloc(qsize);
|
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);
|
memcpy(dst->qp_table, src->qp_table, qsize);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
|
AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
|
||||||
|
Loading…
Reference in New Issue
Block a user