Justin Ruggles <justin.rugg...@gmail.com> writes:

> ---
>  libavcodec/mpc7.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c
> index 8bc0853..db688f9 100644
> --- a/libavcodec/mpc7.c
> +++ b/libavcodec/mpc7.c
> @@ -223,7 +223,8 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void 
> *data,
>          return ret;
>      }
>
> -    bits = av_malloc(((buf_size - 1) & ~3) + FF_INPUT_BUFFER_PADDING_SIZE);
> +    if (!(bits = av_malloc(((buf_size - 1) & ~3) + 
> FF_INPUT_BUFFER_PADDING_SIZE)))
> +        return AVERROR(ENOMEM);

I find this style easier on the eyes:

bits = av_malloc();
if (!bits)
    return ERROR;

-- 
Måns Rullgård
m...@mansr.com
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to