[FFmpeg-cvslog] swscale/slice: Fix wrong return on error

Michael Niedermayer git at videolan.org
Fri Jul 9 16:42:36 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Jul  9 15:20:47 2021 +0200| [7874d40f10cca922797a8da14189a53ee52f0156] | committer: Michael Niedermayer

swscale/slice: Fix wrong return on error

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libswscale/slice.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libswscale/slice.c b/libswscale/slice.c
index 68517da00b..b185b4aa18 100644
--- a/libswscale/slice.c
+++ b/libswscale/slice.c
@@ -288,8 +288,10 @@ int ff_init_filters(SwsContext * c)
     if (!c->desc)
         return AVERROR(ENOMEM);
     c->slice = av_mallocz_array(sizeof(SwsSlice), c->numSlice);
-    if (!c->slice)
+    if (!c->slice) {
+        res = AVERROR(ENOMEM);
         goto cleanup;
+    }
 
     res = alloc_slice(&c->slice[0], c->srcFormat, c->srcH, c->chrSrcH, c->chrSrcHSubSample, c->chrSrcVSubSample, 0);
     if (res < 0) goto cleanup;



More information about the ffmpeg-cvslog mailing list