Message ID | 20210902092322.13352-1-robux4@ycbcr.xyz |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,v3] avcodec/vp9: avoid using uninitialized mutex/condition | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 874005a5ae..f4af90eaec 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1796,6 +1796,10 @@ static av_cold int vp9_decode_init(AVCodecContext *avctx) s->last_bpp = 0; s->s.h.filter.sharpness = -1; + if (avctx->active_thread_type & FF_THREAD_SLICE) { + pthread_mutex_init(&s->progress_mutex, NULL); + pthread_cond_init(&s->progress_cond, NULL); + } for (int i = 0; i < 3; i++) { s->s.frames[i].tf.f = av_frame_alloc();