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)); }