[libav-devel] [PATCH] Use AVERROR return codes in stead of -1. This is a small change for me to get used to the contribution workflow.

Luca Barbato lu_zero at gentoo.org
Wed Aug 5 10:52:38 CEST 2015


On 05/08/15 08:15, Jake Sebastian-Jones wrote:
> ---
>  libavcodec/h264.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Since it is your first patch I'll get you the rightly formatted one
after the review as reference

> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index 7c2b307..768b7a4 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -1274,14 +1274,17 @@ static int get_avc_nalsize(H264Context *h, const uint8_t *buf,
>      int i, nalsize = 0;
>  
>      if (*buf_index >= buf_size - h->nal_length_size)
> -        return -1;
> +    {

it should go next to the `if ()`

> +        av_log(h->avctx, AV_LOG_ERROR, "AVC: buffer too short to read nal");

You should print more information on why it is too short.



More information about the libav-devel mailing list