Fixes: null pointer dereference
Fixes: alloc_slice.mp4
Found-by: Rafael Dutra <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
---
libswscale/slice.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
2.17.1
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".