Module: libav Branch: release/0.8 Commit: ca4a25acf89b715f8f587c947be7145d637a67d1
Author: Reinhard Tartler <[email protected]> Committer: Reinhard Tartler <[email protected]> Date: Fri May 31 22:36:47 2013 +0200 jpegls: factorize return paths Conflicts: libavcodec/jpeglsdec.c (cherry picked from commit 4a4107b48944397c914aa39ee16a82fe44db8c4c) --- libavcodec/jpeglsdec.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index ca0224c..63bf5cf 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -260,7 +260,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; @@ -326,9 +326,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 */ @@ -356,10 +355,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor } } } + +end: av_free(state); av_free(zero); - return 0; + return ret; } _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
