Fix for check i965_check_alloc_surface_bo ret
authorZhao, Halley <halley.zhao@intel.com>
Fri, 21 Mar 2014 07:56:39 +0000 (01:56 -0600)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 23 Apr 2014 06:17:55 +0000 (14:17 +0800)
Signed-off-by: Zhao Halley <halley.zhao@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
(cherry picked from commit 41da810decbb2d64843b95384fc87f7a29152c88)

src/i965_drv_video.c

index b7f8f30..d9fe136 100755 (executable)
@@ -3161,11 +3161,10 @@ VAStatus i965_DeriveImage(VADriverContextP ctx,
         i965_guess_surface_format(ctx, surface, &fourcc, &is_tiled);
         int sampling = get_sampling_from_fourcc(fourcc);
         va_status = i965_check_alloc_surface_bo(ctx, obj_surface, is_tiled, fourcc, sampling);
+        if (va_status != VA_STATUS_SUCCESS)
+            return va_status;
     }
 
-    if (va_status != VA_STATUS_SUCCESS)
-        return va_status;
-
     ASSERT_RET(obj_surface->fourcc, VA_STATUS_ERROR_INVALID_SURFACE);
 
     w_pitch = obj_surface->width;