[Libva] [PATCH] Call preinit_hw_codec callback after successful initialization to avoid segment fault issue on unsupported platform

Zhao Yakui yakui.zhao at intel.com
Wed Oct 29 17:24:21 PDT 2014


Reported-by: Nicholas Andrade <sdnick484 at yahoo.com>
Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 src/i965_drv_video.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 1f7e5d9..03ee60f 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -5680,9 +5680,6 @@ i965_Init(VADriverContextP ctx)
             break;
     }
 
-    if (i965->codec_info->preinit_hw_codec)
-        i965->codec_info->preinit_hw_codec(ctx, i965->codec_info);
-
     if (i == ARRAY_ELEMS(i965_sub_ops)) {
         switch (i965->intel.device_id) {
 #undef CHIPSET
@@ -5698,6 +5695,9 @@ i965_Init(VADriverContextP ctx)
 
         i965->current_context_id = VA_INVALID_ID;
 
+        if (i965->codec_info && i965->codec_info->preinit_hw_codec)
+            i965->codec_info->preinit_hw_codec(ctx, i965->codec_info);
+
         return VA_STATUS_SUCCESS;
     } else {
         i--;
-- 
1.7.10.1



More information about the Libva mailing list