aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-05-26 23:50:40 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-06-07 21:42:24 +0200
commit4ac7405aafb8e66dff2ac926f33b7ff755f224cf (patch)
tree93e25aac74863ebdbefa75889922f89d13b526ce
parent300df41c30c7767729e51be1d09cda02901f9b16 (diff)
downloadffmpeg-4ac7405aafb8e66dff2ac926f33b7ff755f224cf.tar.gz
avcodec/vp8: Check mutex init
Fixes: CID1598556 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vp8.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 8e91613068..3e1f67172a 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -247,7 +247,11 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
return AVERROR(ENOMEM);
}
#if HAVE_THREADS
- pthread_mutex_init(&s->thread_data[i].lock, NULL);
+ ret = pthread_mutex_init(&s->thread_data[i].lock, NULL);
+ if (ret) {
+ free_buffers(s);
+ return AVERROR(ret);
+ }
pthread_cond_init(&s->thread_data[i].cond, NULL);
#endif
}