On Mon, Jul 23, 2012 at 11:13:16AM -0400, Derek Buitenhuis wrote:
> Try and decode broken files, but still fail if explode
> mode is enabled.
> 
> Signed-off-by: Derek Buitenhuis <[email protected]>
> ---
>  libavcodec/v410dec.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c
> index a6f236b..f26ff82 100644
> --- a/libavcodec/v410dec.c
> +++ b/libavcodec/v410dec.c
> @@ -29,8 +29,12 @@ static av_cold int v410_decode_init(AVCodecContext *avctx)
>      avctx->bits_per_raw_sample = 10;
>  
>      if (avctx->width & 1) {
> -        av_log(avctx, AV_LOG_ERROR, "v410 requires even width.\n");
> -        return AVERROR_INVALIDDATA;
> +        if (avctx->err_recognition & AV_EF_EXPLODE) {
> +            av_log(avctx, AV_LOG_ERROR, "v410 requires width to be even.\n");
> +            return AVERROR_INVALIDDATA;
> +        } else {
> +            av_log(avctx, AV_LOG_WARNING, "v410 requires width to be 
> even.\n");
> +        }
>      }
>  
>      avctx->coded_frame = avcodec_alloc_frame();
> -- 

I'd add ", continuing anyway" in the second case but patch LGTM without that
change too.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to