mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
theoradec: Check for valid width/height
If width or height are zero ... there's no video :)
This commit is contained in:
parent
b927d60371
commit
d36a22553b
1 changed files with 10 additions and 0 deletions
|
@ -465,6 +465,9 @@ theora_handle_type_packet (GstTheoraDec * dec)
|
||||||
GST_DEBUG_OBJECT (dec, "after fixup frame dimension %dx%d, offset %d:%d",
|
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);
|
info->width, info->height, dec->info.pic_x, dec->info.pic_y);
|
||||||
|
|
||||||
|
if (info->width == 0 || info->height == 0)
|
||||||
|
goto invalid_dimensions;
|
||||||
|
|
||||||
/* done */
|
/* done */
|
||||||
dec->decoder = th_decode_alloc (&dec->info, dec->setup);
|
dec->decoder = th_decode_alloc (&dec->info, dec->setup);
|
||||||
|
|
||||||
|
@ -535,6 +538,13 @@ not_negotiated:
|
||||||
GST_ERROR_OBJECT (dec, "Failed to negotiate");
|
GST_ERROR_OBJECT (dec, "Failed to negotiate");
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
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
|
static GstFlowReturn
|
||||||
|
|
Loading…
Reference in a new issue