vaapivideomemory: don't crash when trying to allocate 0x0 images.

In some occasions, a buffer pool is created for pre-initialization
purposes regardless of whether a valid image size is available or
not. However, during actual decode stage, the vaapidecode element
is expected to update the srcpad caps with the new dimensions, thus
also triggering a reset of the underlying bufferpool.
This commit is contained in:
Gwenole Beauchesne 2015-01-15 16:14:13 +01:00
parent 6e395c60ac
commit 09dcb1e0f7

View file

@ -60,6 +60,8 @@ get_image_data (GstVaapiImage * image)
static GstVaapiImage *
new_image (GstVaapiDisplay * display, const GstVideoInfo * vip)
{
if (!GST_VIDEO_INFO_WIDTH (vip) || !GST_VIDEO_INFO_HEIGHT (vip))
return NULL;
return gst_vaapi_image_new (display, GST_VIDEO_INFO_FORMAT (vip),
GST_VIDEO_INFO_WIDTH (vip), GST_VIDEO_INFO_HEIGHT (vip));
}