]> granicus.if.org Git - libvpx/commitdiff
Converted assertion to returning error
authorYaowu Xu <yaowu@google.com>
Tue, 15 Oct 2013 21:06:00 +0000 (14:06 -0700)
committerYaowu Xu <yaowu@google.com>
Tue, 15 Oct 2013 21:06:00 +0000 (14:06 -0700)
Assertion happens for invalid input data, the commit replace the
assertion with returning error.

Change-Id: I1b73ae752d64882d984cd23936efe75a757c2b41

vp9/decoder/vp9_decodemv.c

index d89d6b803a50e674da862a96bc017f0921123216..8c1399d799b09783a74143d549380390758f0030 100644 (file)
@@ -504,7 +504,11 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
 
   if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) {
     mbmi->mode = ZEROMV;
-    assert(bsize >= BLOCK_8X8);
+    if (bsize < BLOCK_8X8) {
+        vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
+                           "Invalid usage of segement feature on small blocks");
+        return;
+    }
   } else {
     if (bsize >= BLOCK_8X8)
       mbmi->mode = read_inter_mode(cm, r, inter_mode_ctx);