aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/slice.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-07-07 14:05:26 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:21 +0200
commitf596962a33626a9da0ea4400178fb2a1c9445b35 (patch)
treebe05073980b36ce9704b82168ae311c538f53e4e /libswscale/slice.c
parent4428bd5366988d4ea9f79e145d11144a0a4a0f7c (diff)
downloadffmpeg-f596962a33626a9da0ea4400178fb2a1c9445b35.tar.gz
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/slice.c')
-rw-r--r--libswscale/slice.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/slice.c b/libswscale/slice.c
index e14456f75f..f0e621b057 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;