[FFmpeg-cvslog] sws: return an error code on invalid parameters to sws_scale()

Anton Khirnov git at videolan.org
Sat Jul 3 17:20:01 EEST 2021


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed May 19 09:52:40 2021 +0200| [e355af9be9756e81e6e6d5a51cfc2853c1e5001e] | committer: Anton Khirnov

sws: return an error code on invalid parameters to sws_scale()

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

 libswscale/swscale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 05e716dcc9..9743c56295 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -833,7 +833,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
 
     if (!srcStride || !dstStride || !dst || !srcSlice) {
         av_log(c, AV_LOG_ERROR, "One of the input parameters to sws_scale() is NULL, please check the calling code\n");
-        return 0;
+        return AVERROR(EINVAL);
     }
 
     for (i=0; i<4; i++) {



More information about the ffmpeg-cvslog mailing list