diff mbox series

[FFmpeg-devel,04/13] avcodec/vp9: Don't free buffer known to be NULL

Message ID AM7PR03MB666012C77B73D6F2BB16A98B8FCE9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 84f716ccffbcb15fd272b5678bae6b82e59a95cd
Headers show
Series [FFmpeg-devel,01/13] avcodec/vp9: Do not destroy uninitialized mutexes/conditions
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 2, 2021, 3:41 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/vp9.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 239475cdbe..8eb57eb8e6 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -62,11 +62,8 @@  static int vp9_alloc_entries(AVCodecContext *avctx, int n) {
             av_freep(&s->entries);
 
         s->entries = av_malloc_array(n, sizeof(atomic_int));
-
-        if (!s->entries) {
-            av_freep(&s->entries);
+        if (!s->entries)
             return AVERROR(ENOMEM);
-        }
 
         for (i  = 0; i < n; i++)
             atomic_init(&s->entries[i], 0);