Message ID | 20200711220031.547-2-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 24c575e0aa6b469eeaa1bd8f7ffc0fe6732495d0 |
Headers | show |
Series | [FFmpeg-devel,1/2] swscale/tests/swscale: Fix incorrect return code check | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
On Sun, 12 Jul 2020, Michael Niedermayer wrote: > Regression since: 3adffab073bc59af39dddd035168ac72bc9ffde3 > > -1 is consistent what other error paths return > > Signed-off-by: Michael Niedermayer <michael@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); LGTM Do note that for the return value of a process is limited to the range 0-255 normally, and if returning a negative value, it gets mapped to the upper range (128-255) which normally is used for when a process is killed by a signal. But this issue seems to already be present within this test app, and this change makes it internally consistent at least. // Martin
On Tue, Jul 14, 2020 at 10:44:19AM +0300, Martin Storsjö wrote: > On Sun, 12 Jul 2020, Michael Niedermayer wrote: > > > Regression since: 3adffab073bc59af39dddd035168ac72bc9ffde3 > > > > -1 is consistent what other error paths return > > > > Signed-off-by: Michael Niedermayer <michael@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); > > LGTM will apply > > Do note that for the return value of a process is limited to the range 0-255 > normally, and if returning a negative value, it gets mapped to the upper > range (128-255) which normally is used for when a process is killed by a > signal. But this issue seems to already be present within this test app, and > this change makes it internally consistent at least. yes this should be changed thanks [...]
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);
Regression since: 3adffab073bc59af39dddd035168ac72bc9ffde3 -1 is consistent what other error paths return Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libswscale/tests/swscale.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)