ref: 13338a481ff8782512c761c122e98a631add6873
parent: 0f42d1fa8569532b5bed322bd1662e3d06161544
author: James Zern <jzern@google.com>
date: Tue Aug 23 14:29:42 EDT 2016
vp8_create_decoder_instances: add missing setjmp vp8_decoder_create_threads() has allocations that expect one is set. Change-Id: I423f2153a2969c88d48ba45cc9ead4a01443ce65
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -444,10 +444,17 @@
if (!fb->pbi[0]) return VPX_CODEC_ERROR;
#if CONFIG_MULTITHREAD
- /* enable row-based threading only when use_frame_threads
- * is disabled */
+ if (setjmp(fb->pbi[0]->common.error.jmp)) {
+ vp8_remove_decoder_instances(fb);
+ memset(fb->pbi, 0, sizeof(fb->pbi) / sizeof(fb->pbi[0]));
+ vp8_clear_system_state();
+ return VPX_CODEC_ERROR;
+ }
+
+ fb->pbi[0]->common.error.setjmp = 1;
fb->pbi[0]->max_threads = oxcf->max_threads;
vp8_decoder_create_threads(fb->pbi[0]);
+ fb->pbi[0]->common.error.setjmp = 0;
#endif
} else {
/* TODO : create frame threads and decoder instances for each
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -342,7 +342,7 @@
}
res = vp8_create_decoder_instances(&ctx->yv12_frame_buffers, &oxcf);
- ctx->decoder_init = 1;
+ if (res == VPX_CODEC_OK) ctx->decoder_init = 1;
}
/* Set these even if already initialized. The caller may have changed the