diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-07-07 14:05:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-07-09 12:29:03 +0200 |
commit | 997f9cfc1295769be8d3180860ceebbc16f59069 (patch) | |
tree | e1b985fb15a164155f81bb485642e8368e7b9c95 /libswscale | |
parent | 40ce7aec09e0fd69702543e5bac7a4b09eb401cb (diff) | |
download | ffmpeg-997f9cfc1295769be8d3180860ceebbc16f59069.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>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/slice.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/slice.c b/libswscale/slice.c index d96db13364..68517da00b 100644 --- a/libswscale/slice.c +++ b/libswscale/slice.c @@ -288,7 +288,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; |