Commit 7d84bb2b authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '4a4107b4'

* commit '4a4107b4':
  jpegls: factorize return paths
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents b53d6a47 4a4107b4
...@@ -277,7 +277,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, ...@@ -277,7 +277,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
int i, t = 0; int i, t = 0;
uint8_t *zero, *last, *cur; uint8_t *zero, *last, *cur;
JLSState *state; JLSState *state;
int off = 0, stride = 1, width, shift; int off = 0, stride = 1, width, shift, ret = 0;
zero = av_mallocz(s->picture.linesize[0]); zero = av_mallocz(s->picture.linesize[0]);
last = zero; last = zero;
...@@ -353,9 +353,8 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, ...@@ -353,9 +353,8 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
} }
} else if (ilv == 2) { /* sample interleaving */ } else if (ilv == 2) { /* sample interleaving */
avpriv_report_missing_feature(s->avctx, "Sample interleaved images"); avpriv_report_missing_feature(s->avctx, "Sample interleaved images");
av_free(state); ret = AVERROR_PATCHWELCOME;
av_free(zero); goto end;
return AVERROR_PATCHWELCOME;
} }
if (shift) { /* we need to do point transform or normalize samples */ if (shift) { /* we need to do point transform or normalize samples */
...@@ -381,10 +380,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, ...@@ -381,10 +380,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
} }
} }
} }
end:
av_free(state); av_free(state);
av_free(zero); av_free(zero);
return 0; return ret;
} }
AVCodec ff_jpegls_decoder = { AVCodec ff_jpegls_decoder = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment