aboutsummaryrefslogtreecommitdiff
path: root/lib/ffmpeg
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2013-06-17 22:34:53 +0200
committerMemphiz <memphis@machzwo.de>2013-06-17 22:36:13 +0200
commit2e8f5694a74b01c97e99b8bce7cc3569ce637ade (patch)
treecb7283fe87019444a2aac3ff37cbab450e1d5008 /lib/ffmpeg
parentb74653197bfdd302313f8499ef0fca264ad84ef7 (diff)
[ffmpeg] - backport fix for crashing when using vaapi (found on libav mailing list) - this was signed off by elupus
Diffstat (limited to 'lib/ffmpeg')
-rw-r--r--lib/ffmpeg/libavcodec/vaapi.c3
-rw-r--r--lib/ffmpeg/patches/0038-backport-vaapi-return-early-from-ff_vaapi_render_picture-without-picture.patch22
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/ffmpeg/libavcodec/vaapi.c b/lib/ffmpeg/libavcodec/vaapi.c
index a220a9d3c2..94959bf5ed 100644
--- a/lib/ffmpeg/libavcodec/vaapi.c
+++ b/lib/ffmpeg/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;
diff --git a/lib/ffmpeg/patches/0038-backport-vaapi-return-early-from-ff_vaapi_render_picture-without-picture.patch b/lib/ffmpeg/patches/0038-backport-vaapi-return-early-from-ff_vaapi_render_picture-without-picture.patch
new file mode 100644
index 0000000000..3a6db3dbc0
--- /dev/null
+++ b/lib/ffmpeg/patches/0038-backport-vaapi-return-early-from-ff_vaapi_render_picture-without-picture.patch
@@ -0,0 +1,22 @@
+Subject: [libav-devel] [PATCH 1/2] vaapi: return early from ff_vaapi_render_picture() without picture
+From: Janne Grunau janne-libav at jannau.net
+
+Fixes an assertion when called on uninitialized frame. Spotted after
+seeking in vlc. (backported from libav mailing list)
+
+---
+
+diff --git a/lib/ffmpeg/libavcodec/vaapi.c b/lib/ffmpeg/libavcodec/vaapi.c
+index a220a9d..94959bf 100644
+--- a/lib/ffmpeg/libavcodec/vaapi.c
++++ b/lib/ffmpeg/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;
+