Commit 468a0471 authored by Jean-Paul Saman's avatar Jean-Paul Saman

VAAPI-XCB: extra handling in error path

- subpicture_cache_destroy() set cache pointer to NULL
- CopyPictureToVAImage() invalidate image members
parent fdaa79ac
...@@ -144,6 +144,7 @@ static void subpicture_cache_destroy(vasubpicture_cache_t *cache) ...@@ -144,6 +144,7 @@ static void subpicture_cache_destroy(vasubpicture_cache_t *cache)
assert(cache->image.image_id == VA_INVALID_ID); assert(cache->image.image_id == VA_INVALID_ID);
free(cache); free(cache);
cache = NULL;
} }
unsigned int cache_GetCacheID(const subpicture_cache_t *cache) unsigned int cache_GetCacheID(const subpicture_cache_t *cache)
...@@ -268,7 +269,12 @@ static int CopyPictureToVAImage(vlc_object_t *obj, vlc_va_conn_t *vaconn, ...@@ -268,7 +269,12 @@ static int CopyPictureToVAImage(vlc_object_t *obj, vlc_va_conn_t *vaconn,
status = vaCreateImage(vaconn->p_display, fmt, status = vaCreateImage(vaconn->p_display, fmt,
pic->format.i_width, pic->format.i_height, image); pic->format.i_width, pic->format.i_height, image);
if (status != VA_STATUS_SUCCESS) if (status != VA_STATUS_SUCCESS)
{
msg_Err(obj, "failed to creating image (%d)", status);
image->image_id = VA_INVALID_ID;
image->buf = VA_INVALID_ID;
return VLC_EGENERIC; return VLC_EGENERIC;
}
/* Sanity checks */ /* Sanity checks */
if ((image->image_id == VA_INVALID_ID) || if ((image->image_id == VA_INVALID_ID) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment