]> granicus.if.org Git - libvpx/commitdiff
vp8: kill all threads on corrupted frame.
authorJerome Jiang <jianj@google.com>
Wed, 19 Dec 2018 19:18:55 +0000 (11:18 -0800)
committerJerome Jiang <jianj@google.com>
Fri, 21 Dec 2018 07:20:47 +0000 (07:20 +0000)
If decoder keeps going, threads will be brought up.

BUG=902650,webm:1577

Change-Id: I7765ba134aeed76ec0f58bd05e3a35383e6861c3

test/invalid_file_test.cc
vp8/decoder/decodeframe.c
vp8/decoder/onyxd_if.c
vp8/vp8_dx_iface.c

index 8eed05eb494ad822bf057c7ed2673f91845403e8..a92612af4d9052682145889a7c00cae1c6edb95b 100644 (file)
@@ -123,9 +123,9 @@ TEST_P(InvalidFileTest, ReturnCode) { RunTest(); }
 
 #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,
index f4842ef0384b1ed90eefa8672be0aa41b54beafb..617abf77c46ee479ba8218ec89db32fcda9d86c7 100644 (file)
@@ -1220,8 +1220,10 @@ int vp8_decode_frame(VP8D_COMP *pbi) {
   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;
index 918c68626e7ae0e526dbfb421760abfaab95e71e..e7e1cfc94996b46a002d94901c6b31ec6c2f466e 100644 (file)
@@ -428,6 +428,7 @@ int vp8dx_references_buffer(VP8_COMMON *oci, int ref_frame) {
 }
 
 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;
index 6d1c5f5954a12dfe211a91471a81d72dd32dc624..a72d805052448bcf63350acbe598cbead6c42287 100644 (file)
@@ -439,6 +439,9 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
         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;
     }