shithub: libvpx

Download patch

ref: 0c806817c218aa4bbc165cdb6220387877a445ba
parent: d12f5d3ef79d5f375ea5819a1ce6824d4c2b4377
parent: 6dbf738a43cf2380b9b5cc6fb867b52919ca2a20
author: Jerome Jiang <jianj@google.com>
date: Fri Dec 21 11:24:09 EST 2018

Merge "vp8: kill all threads on corrupted frame."

--- a/test/invalid_file_test.cc
+++ b/test/invalid_file_test.cc
@@ -123,9 +123,9 @@
 
 #if CONFIG_VP8_DECODER
 const DecodeParam kVP8InvalidFileTests[] = {
-  { 1, "invalid-bug-1443.ivf" },
+  { 1, "invalid-bug-1443-v2.ivf" },
   { 1, "invalid-token-partition.ivf" },
-  { 1, "invalid-vp80-00-comprehensive-s17661_r01-05_b6-.ivf" },
+  { 1, "invalid-vp80-00-comprehensive-s17661_r01-05_b6-.v2.ivf" },
 };
 
 VP8_INSTANTIATE_TEST_CASE(InvalidFileTest,
--- a/vp8/decoder/decodeframe.c
+++ b/vp8/decoder/decodeframe.c
@@ -1220,8 +1220,10 @@
   if (vpx_atomic_load_acquire(&pbi->b_multithreaded_rd) &&
       pc->multi_token_partition != ONE_PARTITION) {
     unsigned int thread;
-    if (vp8mt_decode_mb_rows(pbi, xd))
+    if (vp8mt_decode_mb_rows(pbi, xd)) {
+      vp8_decoder_remove_threads(pbi);
       vpx_internal_error(&pbi->common.error, VPX_CODEC_CORRUPT_FRAME, NULL);
+    }
     vp8_yv12_extend_frame_borders(yv12_fb_new);
     for (thread = 0; thread < pbi->decoding_thread_count; ++thread) {
       corrupt_tokens |= pbi->mb_row_di[thread].mbd.corrupted;
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -428,6 +428,7 @@
 }
 
 int vp8_create_decoder_instances(struct frame_buffers *fb, VP8D_CONFIG *oxcf) {
+  if (fb->pbi[0]) remove_decompressor(fb->pbi[0]);
   /* decoder instance for single thread mode */
   fb->pbi[0] = create_decompressor(oxcf);
   if (!fb->pbi[0]) return VPX_CODEC_ERROR;
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -439,6 +439,9 @@
         pc->fb_idx_ref_cnt[pc->new_fb_idx]--;
       }
       pc->error.setjmp = 0;
+      ctx->si.w = 0;
+      ctx->si.h = 0;
+      ctx->decoder_init = 0;
       res = update_error_state(ctx, &pbi->common.error);
       return res;
     }