On 10/27/2013 06:10 AM, Anton Khirnov wrote:
> ---
>  libavcodec/libopenjpegdec.c |   11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
> index 0062701..77a37e9 100644
> --- a/libavcodec/libopenjpegdec.c
> +++ b/libavcodec/libopenjpegdec.c
> @@ -33,6 +33,7 @@
>  #include "libavutil/pixfmt.h"
>  #include "libavutil/opt.h"
>  #include "avcodec.h"
> +#include "internal.h"
>  #include "thread.h"
>  
>  #define JP2_SIG_TYPE    0x6A502020
> @@ -315,13 +316,9 @@ static int libopenjpeg_decode_frame(AVCodecContext 
> *avctx,
>          height = (height + (1 << ctx->lowres) - 1) >> ctx->lowres;
>      }
>  
> -    if ((ret = av_image_check_size(width, height, 0, avctx)) < 0) {
> -        av_log(avctx, AV_LOG_ERROR,
> -               "%dx%d dimension invalid.\n", width, height);
> -        goto done;
> -    }
> -
> -    avcodec_set_dimensions(avctx, width, height);
> +    ret = ff_set_dimensions(avctx, width, height);
> +    if (ret < 0)
> +        return ret;
>  
>      if (avctx->pix_fmt != AV_PIX_FMT_NONE)
>          if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt))

It looks like 'goto done' is needed to do some cleaning up.

-Justin

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to