[FFmpeg-cvslog] swscale/slice: Check slice for allocation failure

2021-09-08 Thread Michael Niedermayer
ffmpeg | branch: release/4.4 | Michael Niedermayer  | 
Wed Jul  7 14:05:26 2021 +0200| [8da08ef1ffe7b2297a07d631038ddf4021c51ae1] | 
committer: Michael Niedermayer

swscale/slice: Check slice for allocation failure

Fixes: null pointer dereference
Fixes: alloc_slice.mp4

Found-by: Rafael Dutra 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 997f9cfc1295769be8d3180860ceebbc16f59069)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8da08ef1ffe7b2297a07d631038ddf4021c51ae1
---

 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(>slice[0], c->srcFormat, c->srcH, c->chrSrcH, 
c->chrSrcHSubSample, c->chrSrcVSubSample, 0);
 if (res < 0) goto cleanup;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] swscale/slice: Check slice for allocation failure

2021-07-09 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Jul  7 14:05:26 2021 +0200| [997f9cfc1295769be8d3180860ceebbc16f59069] | 
committer: Michael Niedermayer

swscale/slice: Check slice for allocation failure

Fixes: null pointer dereference
Fixes: alloc_slice.mp4

Found-by: Rafael Dutra 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=997f9cfc1295769be8d3180860ceebbc16f59069
---

 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(>slice[0], c->srcFormat, c->srcH, c->chrSrcH, 
c->chrSrcHSubSample, c->chrSrcVSubSample, 0);
 if (res < 0) goto cleanup;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".