jpegls: factorize return paths
Conflicts:
libavcodec/jpeglsdec.c
(cherry picked from commit 4a4107b489
)
This commit is contained in:
@@ -259,7 +259,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
|
||||
int i, t = 0;
|
||||
uint8_t *zero, *last, *cur;
|
||||
JLSState *state;
|
||||
int off = 0, stride = 1, width, shift;
|
||||
int off = 0, stride = 1, width, shift, ret = 0;
|
||||
|
||||
zero = av_mallocz(s->picture_ptr->linesize[0]);
|
||||
last = zero;
|
||||
@@ -329,9 +329,8 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
|
||||
}
|
||||
} else if (ilv == 2) { /* sample interleaving */
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n");
|
||||
av_free(state);
|
||||
av_free(zero);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
ret = AVERROR_PATCHWELCOME;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if(shift){ /* we need to do point transform or normalize samples */
|
||||
@@ -359,10 +358,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
av_free(state);
|
||||
av_free(zero);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user