summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2013-09-29 13:11:10 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-09-30 15:24:13 +0800
commit0c2def319f52bdb222e5480d81feea486cbf3e11 (patch)
tree495edc92d27c3053303f355dfca023c7b096e0a5
parent6ad68f55e9ba49af541a5e4d86a305bbd0f22d63 (diff)
Check the reference surface id against VA_INVALID_SURFACE
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r--src/gen6_mfc_common.c4
-rw-r--r--src/gen6_vme.c4
-rw-r--r--src/gen75_vme.c4
-rw-r--r--src/gen7_vme.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/src/gen6_mfc_common.c b/src/gen6_mfc_common.c
index 88a8d61..d66f4c5 100644
--- a/src/gen6_mfc_common.c
+++ b/src/gen6_mfc_common.c
@@ -1036,7 +1036,7 @@ intel_mfc_avc_ref_idx_state(VADriverContextP ctx,
if (slice_type == SLICE_TYPE_P || slice_type == SLICE_TYPE_B) {
slice_obj_surface = NULL;
ref_surface_id = slice_param->RefPicList0[0].picture_id;
- if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+ if (ref_surface_id != VA_INVALID_SURFACE) {
slice_obj_surface = SURFACE(ref_surface_id);
}
if (slice_obj_surface && slice_obj_surface->bo) {
@@ -1067,7 +1067,7 @@ intel_mfc_avc_ref_idx_state(VADriverContextP ctx,
if (slice_type == SLICE_TYPE_B) {
slice_obj_surface = NULL;
ref_surface_id = slice_param->RefPicList1[0].picture_id;
- if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+ if (ref_surface_id != VA_INVALID_SURFACE) {
slice_obj_surface = SURFACE(ref_surface_id);
}
if (slice_obj_surface && slice_obj_surface->bo) {
diff --git a/src/gen6_vme.c b/src/gen6_vme.c
index 1d47517..1345466 100644
--- a/src/gen6_vme.c
+++ b/src/gen6_vme.c
@@ -223,7 +223,7 @@ gen6_vme_surface_setup(VADriverContextP ctx,
if (slice_type == SLICE_TYPE_P || slice_type == SLICE_TYPE_B) {
slice_obj_surface = NULL;
ref_surface_id = slice_param->RefPicList0[0].picture_id;
- if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+ if (ref_surface_id != VA_INVALID_SURFACE) {
slice_obj_surface = SURFACE(ref_surface_id);
}
if (slice_obj_surface && slice_obj_surface->bo) {
@@ -239,7 +239,7 @@ gen6_vme_surface_setup(VADriverContextP ctx,
/* reference 1 */
slice_obj_surface = NULL;
ref_surface_id = slice_param->RefPicList1[0].picture_id;
- if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+ if (ref_surface_id != VA_INVALID_SURFACE) {
slice_obj_surface = SURFACE(ref_surface_id);
}
if (slice_obj_surface && slice_obj_surface->bo) {
diff --git a/src/gen75_vme.c b/src/gen75_vme.c
index 515d8c0..e9ddf0b 100644
--- a/src/gen75_vme.c
+++ b/src/gen75_vme.c
@@ -284,7 +284,7 @@ gen75_vme_surface_setup(VADriverContextP ctx,
if (slice_type == SLICE_TYPE_P || slice_type == SLICE_TYPE_B) {
slice_obj_surface = NULL;
ref_surface_id = slice_param->RefPicList0[0].picture_id;
- if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+ if (ref_surface_id != VA_INVALID_SURFACE) {
slice_obj_surface = SURFACE(ref_surface_id);
}
if (slice_obj_surface && slice_obj_surface->bo) {
@@ -300,7 +300,7 @@ gen75_vme_surface_setup(VADriverContextP ctx,
/* reference 1 */
slice_obj_surface = NULL;
ref_surface_id = slice_param->RefPicList1[0].picture_id;
- if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+ if (ref_surface_id != VA_INVALID_SURFACE) {
slice_obj_surface = SURFACE(ref_surface_id);
}
if (slice_obj_surface && slice_obj_surface->bo) {
diff --git a/src/gen7_vme.c b/src/gen7_vme.c
index e6de3af..2f167ab 100644
--- a/src/gen7_vme.c
+++ b/src/gen7_vme.c
@@ -269,7 +269,7 @@ gen7_vme_surface_setup(VADriverContextP ctx,
if (slice_type == SLICE_TYPE_P || slice_type == SLICE_TYPE_B) {
slice_obj_surface = NULL;
ref_surface_id = slice_param->RefPicList0[0].picture_id;
- if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+ if (ref_surface_id != VA_INVALID_SURFACE) {
slice_obj_surface = SURFACE(ref_surface_id);
}
if (slice_obj_surface && slice_obj_surface->bo) {
@@ -285,7 +285,7 @@ gen7_vme_surface_setup(VADriverContextP ctx,
/* reference 1 */
slice_obj_surface = NULL;
ref_surface_id = slice_param->RefPicList1[0].picture_id;
- if (ref_surface_id != 0 && ref_surface_id != VA_INVALID_SURFACE) {
+ if (ref_surface_id != VA_INVALID_SURFACE) {
slice_obj_surface = SURFACE(ref_surface_id);
}
if (slice_obj_surface && slice_obj_surface->bo) {