diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-07-07 14:05:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-06 13:54:16 +0200 |
commit | b72df5e492250c73e4a8a6c399179e4cb29187e5 (patch) | |
tree | b33b7ca284ec3f7a8d59c71c365a979e43dc391c | |
parent | 452e7cba2c59ece2074915f1fc2c0b1ea9788750 (diff) | |
download | ffmpeg-b72df5e492250c73e4a8a6c399179e4cb29187e5.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>
-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 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; |