]> git.sesse.net Git - ffmpeg/commitdiff
swscale/tests/swscale: Initialize res to a non random error code
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 11 Jul 2020 21:57:41 +0000 (23:57 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 14 Jul 2020 20:05:02 +0000 (22:05 +0200)
Regression since: 3adffab073bc59af39dddd035168ac72bc9ffde3

-1 is consistent what other error paths return

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libswscale/tests/swscale.c

index 58870fdb78c9084d6086787ea8e39b49dca5bbc9..845ced61bba02f53f08c351511978cc8525a8f87 100644 (file)
@@ -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);