Complain the warning instead of assert fault when slice picture is not found in DPB...
authorZhao Yakui <yakui.zhao@intel.com>
Mon, 13 Jan 2014 01:42:28 +0000 (09:42 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 27 Feb 2014 02:30:26 +0000 (10:30 +0800)
This is to fix the bug https://bugs.freedesktop.org/show_bug.cgi?id=72660

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
src/i965_decoder_utils.c

index 51d38a6..e0d0763 100644 (file)
@@ -268,6 +268,7 @@ gen5_fill_avc_ref_idx_state(
 )
 {
     unsigned int i, n, frame_idx;
+    int found;
 
     for (i = 0, n = 0; i < ref_list_count; i++) {
         const VAPictureH264 * const va_pic = &ref_list[i];
@@ -275,16 +276,21 @@ gen5_fill_avc_ref_idx_state(
         if (va_pic->flags & VA_PICTURE_H264_INVALID)
             continue;
 
+        found = 0;
         for (frame_idx = 0; frame_idx < MAX_GEN_REFERENCE_FRAMES; frame_idx++) {
             const GenFrameStore * const fs = &frame_store[frame_idx];
             if (fs->surface_id != VA_INVALID_ID &&
                 fs->surface_id == va_pic->picture_id) {
-                assert(frame_idx == fs->frame_store_id);
+                found = 1;
                 break;
             }
         }
-        assert(frame_idx < MAX_GEN_REFERENCE_FRAMES);
-        state[n++] = get_ref_idx_state_1(va_pic, frame_idx);
+
+        if (found) {
+            state[n++] = get_ref_idx_state_1(va_pic, frame_idx);
+        } else {
+            WARN_ONCE("Invalid Slice reference frame list !!!. It is not included in DPB \n");
+        }
     }
 
     for (; n < 32; n++)