swscale/slice: Fix wrong return on error

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/359/head
Michael Niedermayer 4 years ago
parent eaec4df63f
commit 7874d40f10
  1. 4
      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;

Loading…
Cancel
Save