Index: source/libvpx/vp9/decoder/vp9_dthread.c |
=================================================================== |
--- source/libvpx/vp9/decoder/vp9_dthread.c (revision 292608) |
+++ source/libvpx/vp9/decoder/vp9_dthread.c (working copy) |
@@ -223,14 +223,18 @@ |
CHECK_MEM_ERROR(cm, lf_sync->mutex_, |
vpx_malloc(sizeof(*lf_sync->mutex_) * rows)); |
- for (i = 0; i < rows; ++i) { |
- pthread_mutex_init(&lf_sync->mutex_[i], NULL); |
+ if (lf_sync->mutex_) { |
+ for (i = 0; i < rows; ++i) { |
+ pthread_mutex_init(&lf_sync->mutex_[i], NULL); |
+ } |
} |
CHECK_MEM_ERROR(cm, lf_sync->cond_, |
vpx_malloc(sizeof(*lf_sync->cond_) * rows)); |
- for (i = 0; i < rows; ++i) { |
- pthread_cond_init(&lf_sync->cond_[i], NULL); |
+ if (lf_sync->cond_) { |
+ for (i = 0; i < rows; ++i) { |
+ pthread_cond_init(&lf_sync->cond_[i], NULL); |
+ } |
} |
} |
#endif // CONFIG_MULTITHREAD |