ref: 6f7ab01451c3b1401a7a4823947d73f86aebe893
parent: 99874f55fb2a5a24b05074c716570e17bb6583d2
author: James Zern <jzern@google.com>
date: Tue Dec 2 11:51:27 EST 2014
vp9: sync threads after a longjmp Synchronize all threads immediately as a subsequent decode call may cause a resize invalidating some allocations. fixes one aspect of crbug.com/437655 Change-Id: Ie993b62c2756478543206ddbe43ec6268d90a470
--- a/vp9/decoder/vp9_decoder.c
+++ b/vp9/decoder/vp9_decoder.c
@@ -273,8 +273,19 @@
cm->cur_frame = &cm->frame_bufs[cm->new_fb_idx];
if (setjmp(cm->error.jmp)) {
+ const VP9WorkerInterface *const winterface = vp9_get_worker_interface();
+ int i;
+
pbi->need_resync = 1;
cm->error.setjmp = 0;
+
+ // Synchronize all threads immediately as a subsequent decode call may
+ // cause a resize invalidating some allocations.
+ winterface->sync(&pbi->lf_worker);
+ for (i = 0; i < pbi->num_tile_workers; ++i) {
+ winterface->sync(&pbi->tile_workers[i]);
+ }
+
vp9_clear_system_state();
// We do not know if the missing frame(s) was supposed to update