[FFmpeg-devel] [PATCH] lavc/h263dec: return or propagate proper error codes

Michael Niedermayer michaelni at gmx.at
Mon Sep 10 18:21:31 CEST 2012


On Mon, Sep 10, 2012 at 06:15:40PM +0200, Stefano Sabatini wrote:
> Also add a missing log.
> ---
>  libavcodec/h263dec.c |   41 +++++++++++++++++++++++------------------
>  1 files changed, 23 insertions(+), 18 deletions(-)
> 
> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index 6c01e00..f3d6d9d 100644
> --- a/libavcodec/h263dec.c
> +++ b/libavcodec/h263dec.c
> @@ -47,6 +47,7 @@
>  av_cold int ff_h263_decode_init(AVCodecContext *avctx)
>  {
>      MpegEncContext *s = avctx->priv_data;
> +    int ret;
>  
>      s->avctx = avctx;
>      s->out_format = FMT_H263;

> @@ -110,15 +111,17 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
>          s->h263_flv = 1;
>          break;
>      default:
> -        return -1;
> +        av_log(avctx, AV_LOG_ERROR, "Invalid codec ID '%s'\n",
> +               avcodec_get_name(avctx->codec_id));
> +        return AVERROR(EINVAL);
>      }

can this happen ? if not it could as well be an assert

the rest should be ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120910/4a394abb/attachment.asc>


More information about the ffmpeg-devel mailing list