diff mbox series

[FFmpeg-devel,08/17] avcodec/vp8: Check mutex init

Message ID 20240526235230.2876318-8-michael@niedermayer.cc
State Accepted
Commit 4ac7405aafb8e66dff2ac926f33b7ff755f224cf
Headers show
Series [FFmpeg-devel,01/17] avcodec/dxva2: Initialize dxva_size and check it | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer May 26, 2024, 11:52 p.m. UTC
Fixes: CID1598556 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/vp8.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer June 7, 2024, noon UTC | #1
On Mon, May 27, 2024 at 01:52:20AM +0200, Michael Niedermayer wrote:
> Fixes: CID1598556 Unchecked return value
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vp8.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

will apply the vp8 patches of this set

[...]
diff mbox series

Patch

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 8e91613068a..3e1f67172ae 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
     }