[FFmpeg-devel] [PATCH 2/2] swscale/tests/swscale: Initialize res to a non random error code

Michael Niedermayer michael at niedermayer.cc
Sun Jul 12 01:00:31 EEST 2020


Regression since: 3adffab073bc59af39dddd035168ac72bc9ffde3

-1 is consistent what other error paths return

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libswscale/tests/swscale.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
index 58870fdb78..845ced61bb 100644
--- a/libswscale/tests/swscale.c
+++ b/libswscale/tests/swscale.c
@@ -423,8 +423,10 @@ bad_option:
         for (x = 0; x < W * 4; x++)
             rgb_data[ x + y * 4 * W] = av_lfg_get(&rand);
     res = sws_scale(sws, rgb_src, rgb_stride, 0, H / 12, (uint8_t * const *) src, stride);
-    if (res < 0 || res != H)
+    if (res < 0 || res != H) {
+        res = -1;
         goto error;
+    }
     sws_freeContext(sws);
     av_free(rgb_data);
 
-- 
2.17.1



More information about the ffmpeg-devel mailing list