On Fri, May 17, 2013 at 12:39:46PM +0200, Luca Barbato wrote:
> ---
>
> Needed by following patches adding more failure paths.
>
> libavcodec/jpeglsdec.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
> index ca85def..707295b 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;
> @@ -348,9 +348,8 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int
> near,
> } 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(ENOSYS);
> + ret = AVERROR(ENOSYS);
> + goto out;
> }
>
> if (shift) { /* we need to do point transform or normalize samples */
> @@ -376,10 +375,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int
> near,
> }
> }
> }
> +
> +out:
> av_free(state);
> av_free(zero);
>
> - return 0;
> + return ret;
> }
>
> AVCodec ff_jpegls_decoder = {
> --
fine with me though I'd name label "end".
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel