[libav-devel] [PATCH 1/2] vaapi: return early from ff_vaapi_render_picture() without picture

Janne Grunau janne-libav at jannau.net
Tue May 21 10:55:10 CEST 2013


Fixes an assertion when called on uninitialized frame. Spotted after
seeking in vlc.

CC: libav-stable at libav.org
---
 libavcodec/vaapi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index 0532daf..875d80a 100644
--- a/libavcodec/vaapi.c
+++ b/libavcodec/vaapi.c
@@ -46,6 +46,9 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
     VABufferID va_buffers[3];
     unsigned int n_va_buffers = 0;
 
+    if (!vactx->pic_param_buf_id)
+        return 0;
+
     vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
     va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
 
-- 
1.8.2.1



More information about the libav-devel mailing list