From 802b3b98985c93d63f71c5ec027fc0a84bceb6ee Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Wed, 23 Jun 2021 12:11:28 +0200 Subject: [PATCH] theoradec: add another assert to check the buffer size If the buffer has no video meta then the meta is created from the local data. In this case, the other asserts don't actually check anything. So add another one to ensure that the buffer is actually large enough. Part-of: --- subprojects/gst-plugins-base/ext/theora/gsttheoradec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subprojects/gst-plugins-base/ext/theora/gsttheoradec.c b/subprojects/gst-plugins-base/ext/theora/gsttheoradec.c index fa08804ae9..827a7c85a5 100644 --- a/subprojects/gst-plugins-base/ext/theora/gsttheoradec.c +++ b/subprojects/gst-plugins-base/ext/theora/gsttheoradec.c @@ -710,6 +710,8 @@ theora_handle_image (GstTheoraDec * dec, th_ycbcr_buffer buf, g_assert (vmeta->format == dec->output_state->info.finfo->format); g_assert (vmeta->width == dec->info.frame_width); g_assert (vmeta->height == dec->info.frame_height); + g_assert (gst_buffer_get_size (frame->output_buffer) >= + dec->uncropped_info.size); cmeta = gst_buffer_add_video_crop_meta (frame->output_buffer);