[vlc-commits] avcodec: vaapi: add missing error check

Thomas Guillem git at videolan.org
Tue Nov 7 11:53:02 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sun Sep  3 10:31:24 2017 +0200| [76d70e126ef0bf09d07b1f44175c0ba3eae025bd] | committer: Thomas Guillem

avcodec: vaapi: add missing error check

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=76d70e126ef0bf09d07b1f44175c0ba3eae025bd
---

 modules/codec/avcodec/vaapi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index 5aa6ad6ae5..5cb69417c8 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -324,6 +324,8 @@ static int CreateDRM(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt
     sys->hw_ctx.config_id =
         vlc_vaapi_CreateConfigChecked(o, sys->hw_ctx.display, i_profile,
                                       VAEntrypointVLD, 0);
+    if (sys->hw_ctx.config_id == VA_INVALID_ID)
+        goto error;
 
     /* Create surfaces */
     assert(ctx->coded_width > 0 && ctx->coded_height > 0);



More information about the vlc-commits mailing list