Add aom_merge_corrupted_flag to simplify debugging

This function allows us to set breakpoint when error happens.

Change-Id: I0074a26142625fb95728ed6aa003453ab4203c0f
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 0a298bf..47fd153 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -788,7 +788,7 @@
                        "Invalid scale factors");
   av1_setup_pre_planes(xd, idx, ref_buffer->buf, mi_row, mi_col,
                        &ref_buffer->sf);
-  xd->corrupted |= ref_buffer->buf->corrupted;
+  aom_merge_corrupted_flag(&xd->corrupted, ref_buffer->buf->corrupted);
 }
 
 static void dec_predict_b_extend(
@@ -1486,7 +1486,8 @@
   xd->mi[0]->mbmi.segment_id_supertx = MAX_SEGMENTS;
 #endif  // CONFIG_SUPERTX
 
-  xd->corrupted |= aom_reader_has_error(r);
+  int reader_corrupted_flag = aom_reader_has_error(r);
+  aom_merge_corrupted_flag(&xd->corrupted, reader_corrupted_flag);
 }
 
 static void decode_token_and_recon_block(AV1Decoder *const pbi,
@@ -1787,7 +1788,8 @@
   }
 #endif
 
-  xd->corrupted |= aom_reader_has_error(r);
+  int reader_corrupted_flag = aom_reader_has_error(r);
+  aom_merge_corrupted_flag(&xd->corrupted, reader_corrupted_flag);
 }
 
 #if CONFIG_NCOBMC && CONFIG_MOTION_VAR
@@ -3601,7 +3603,7 @@
                                cm->sb_size);
 #endif
         }
-        pbi->mb.corrupted |= td->xd.corrupted;
+        aom_merge_corrupted_flag(&pbi->mb.corrupted, td->xd.corrupted);
         if (pbi->mb.corrupted)
           aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
                              "Failed to decode tile data");
@@ -3718,7 +3720,7 @@
 
   if (setjmp(tile_data->error_info.jmp)) {
     tile_data->error_info.setjmp = 0;
-    tile_data->xd.corrupted = 1;
+    aom_merge_corrupted_flag(&tile_data->xd.corrupted, 1);
     return 0;
   }
 
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index a49bd09..53717f1 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1884,7 +1884,7 @@
 #endif  // CONFIG_EXT_INTER
                        nearest_sub8x8, near_sub8x8, mi_row, mi_col, is_compound,
                        allow_hp, r)) {
-          xd->corrupted |= 1;
+          aom_merge_corrupted_flag(&xd->corrupted, 1);
           break;
         };
 
@@ -1925,7 +1925,7 @@
       nearestmv[ref] = ref_mv[ref];
     }
 
-    xd->corrupted |=
+    int mv_corrupted_flag =
         !assign_mv(cm, xd, mbmi->mode, mbmi->ref_frame, 0, mbmi->mv,
 #if CONFIG_EXT_INTER
                    mbmi->mode == NEWFROMNEARMV ? nearmv : nearestmv,
@@ -1933,6 +1933,7 @@
                    ref_mv,
 #endif  // CONFIG_EXT_INTER
                    nearestmv, nearmv, mi_row, mi_col, is_compound, allow_hp, r);
+    aom_merge_corrupted_flag(&xd->corrupted, mv_corrupted_flag);
   }
 
 #if CONFIG_EXT_INTER