Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-07-07 15:05:26 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-12 12:22:04 +0300
commita6f5191f2ecbfd25f4ffbb6ad14136e34d97cacd (patch)
tree8b5c046267ebcb79d7b057bca496045470b7ed8d /libswscale
parent9cfd59b5fa52a2da6ac59dc15d5959401ac6b6fe (diff)
swscale/slice: Check slice for allocation failure
Fixes: null pointer dereference Fixes: alloc_slice.mp4 Found-by: Rafael Dutra <rafael.dutra@cispa.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 997f9cfc1295769be8d3180860ceebbc16f59069) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/slice.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/slice.c b/libswscale/slice.c
index db4fa874ff..6599f88373 100644
--- a/libswscale/slice.c
+++ b/libswscale/slice.c
@@ -286,7 +286,8 @@ int ff_init_filters(SwsContext * c)
if (!c->desc)
return AVERROR(ENOMEM);
c->slice = av_mallocz_array(sizeof(SwsSlice), c->numSlice);
-
+ if (!c->slice)
+ goto cleanup;
res = alloc_slice(&c->slice[0], c->srcFormat, c->srcH, c->chrSrcH, c->chrSrcHSubSample, c->chrSrcVSubSample, 0);
if (res < 0) goto cleanup;