From 7e4f32f4e4b93c95dcc872cb844c5548e69f352e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 23 Feb 2017 15:19:32 +0100 Subject: [PATCH] avutil/frame: Disallow zero sized frame side data There should be no case that needs this and its a potential for creating corner cases Signed-off-by: Michael Niedermayer --- libavutil/frame.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/frame.c b/libavutil/frame.c index 8811dcdcfe..69ee240758 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -668,6 +668,8 @@ AVFrameSideData *av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, int size) { + if (size <= 0) + return NULL; return frame_new_side_data(frame, type, av_buffer_alloc(size)); }