mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-14 03:11:25 +00:00
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 997f9cfc12)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
9cfd59b5fa
commit
a6f5191f2e
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue