From d36a22553b9304594a97c11a55fac3020a088c96 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 17 Jan 2018 14:35:11 +0100 Subject: [PATCH] theoradec: Check for valid width/height If width or height are zero ... there's no video :) --- ext/theora/gsttheoradec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c index 01f738d0c4..a506d2bd73 100644 --- a/ext/theora/gsttheoradec.c +++ b/ext/theora/gsttheoradec.c @@ -465,6 +465,9 @@ theora_handle_type_packet (GstTheoraDec * dec) GST_DEBUG_OBJECT (dec, "after fixup frame dimension %dx%d, offset %d:%d", info->width, info->height, dec->info.pic_x, dec->info.pic_y); + if (info->width == 0 || info->height == 0) + goto invalid_dimensions; + /* done */ dec->decoder = th_decode_alloc (&dec->info, dec->setup); @@ -535,6 +538,13 @@ not_negotiated: GST_ERROR_OBJECT (dec, "Failed to negotiate"); return GST_FLOW_NOT_NEGOTIATED; } + +invalid_dimensions: + { + GST_ERROR_OBJECT (dec, "Invalid dimensions (width:%d, height:%d)", + info->width, info->height); + return GST_FLOW_ERROR; + } } static GstFlowReturn