[FFmpeg-cvslog] vaapi: return early from ff_vaapi_render_picture() without picture

Janne Grunau git at videolan.org
Tue Jun 18 02:04:11 CEST 2013


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Tue Jun 18 01:56:06 2013 +0200| [2ee380aefbb92c89e8e9c7aa5846aa404919ec7c] | committer: Carl Eugen Hoyos

vaapi: return early from ff_vaapi_render_picture() without picture

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

Tested-by: Timo
Reviewed-by: Joakim Plate
Signed-off-by: Carl Eugen Hoyos <cehoyos at ag.or.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ee380aefbb92c89e8e9c7aa5846aa404919ec7c
---

 libavcodec/vaapi.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index a220a9d..94959bf 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;
 



More information about the ffmpeg-cvslog mailing list