diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 3e1f67172a..d6df018655 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -252,7 +252,11 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7) free_buffers(s); return AVERROR(ret); } - pthread_cond_init(&s->thread_data[i].cond, NULL); + ret = pthread_cond_init(&s->thread_data[i].cond, NULL); + if (ret) { + free_buffers(s); + return AVERROR(ret); + } #endif }