]> granicus.if.org Git - libvpx/commitdiff
vp9.read_inter_block_mode_info: return on corruption
authorJames Zern <jzern@google.com>
Fri, 19 Aug 2022 00:51:19 +0000 (17:51 -0700)
committerJames Zern <jzern@google.com>
Fri, 19 Aug 2022 16:58:39 +0000 (09:58 -0700)
with block sizes < 8x8 previously only the inner loop was aborted. this
could cause propagation of invalid motion vectors to scale_mv().

this quiets integer sanitizer warnings of the form:
vp9/common/vp9_mvref_common.h:239:18: runtime error: implicit conversion
from type 'int' of value 32768 (32-bit, signed) to type 'int16_t' (aka
'short') changed the value to -32768 (16-bit, signed)

Bug: b/229626362
Change-Id: I58b5a425adf21542cbf4cc4dd5ab3cc5ed008264

vp9/decoder/vp9_decodemv.c

index 8a8d2ad86ee6d9eb33f38bf4cbfe36337a62bee6..f4bfb785f704ff159f6b060c8dedd0bb3c51c362 100644 (file)
@@ -755,7 +755,7 @@ static void read_inter_block_mode_info(VP9Decoder *const pbi,
         if (!assign_mv(cm, xd, b_mode, mi->bmi[j].as_mv, best_ref_mvs,
                        best_sub8x8, is_compound, allow_hp, r)) {
           xd->corrupted |= 1;
-          break;
+          return;
         }
 
         if (num_4x4_h == 2) mi->bmi[j + 2] = mi->bmi[j];