diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-05-17 12:38:44 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-05-17 16:44:13 +0200 |
commit | 4a4107b48944397c914aa39ee16a82fe44db8c4c (patch) | |
tree | c34f2c5195c95cfd2e493863241cdadcffb2145d | |
parent | a5a0ef5e13a59ff53318a45d77c5624b23229c6f (diff) | |
download | ffmpeg-4a4107b48944397c914aa39ee16a82fe44db8c4c.tar.gz |
jpegls: factorize return paths
-rw-r--r-- | libavcodec/jpeglsdec.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index cec561226a..3616063bf1 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -274,7 +274,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, 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; @@ -347,9 +347,8 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, } } else if (ilv == 2) { /* sample interleaving */ avpriv_report_missing_feature(s->avctx, "Sample interleaved images"); - 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 */ @@ -375,10 +374,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, } } } + +end: av_free(state); av_free(zero); - return 0; + return ret; } AVCodec ff_jpegls_decoder = { |