summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2018-01-17 14:35:11 +0100
committerSebastian Dröge <sebastian@centricular.com>2018-01-17 15:58:40 +0200
commitd00968b05102059c900f79b03b57ed3d54b621af (patch)
tree8a1038bf247a7b906db8998e3cbd9b49e40d7917
parent76e35a9031f0731b5fc452d801381ad55c4ba017 (diff)
downloadgstreamer-plugins-base-d00968b05102059c900f79b03b57ed3d54b621af.tar.gz
theoradec: Check for valid width/height
If width or height are zero ... there's no video :)
-rw-r--r--ext/theora/gsttheoradec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c
index 14bd5b81d..5820b8f2c 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);
@@ -528,6 +531,13 @@ unsupported_format:
GST_ERROR_OBJECT (dec, "Invalid pixel format %d", dec->info.pixel_fmt);
return GST_FLOW_ERROR;
}
+
+invalid_dimensions:
+ {
+ GST_ERROR_OBJECT (dec, "Invalid dimensions (width:%d, height:%d)",
+ info->width, info->height);
+ return GST_FLOW_ERROR;
+ }
}
static GstFlowReturn