[FFmpeg-devel] [PATCH 18/19] loco: fix return value.

Paul B Mahol onemda at gmail.com
Sun Jul 29 16:20:47 CEST 2012


On 7/29/12, Nicolas George <nicolas.george at normalesup.org> wrote:
> The return value was the number of bytes left,
> it is supposed to be the number of bytes used.
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavcodec/loco.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/loco.c b/libavcodec/loco.c
> index fb33641..d604bf9 100644
> --- a/libavcodec/loco.c
> +++ b/libavcodec/loco.c
> @@ -233,7 +233,7 @@ stop:
>      *data_size = sizeof(AVFrame);
>      *(AVFrame*)data = l->pic;
>
> -    return buf_size < 0 ? -1 : buf_size;
> +    return buf_size < 0 ? -1 : avpkt->size - buf_size;
>  }
>

buf_size will increase by 1 in case of loco_decode_plane_failure.

Your patch is nice idea but this decoder needs much more love.


More information about the ffmpeg-devel mailing list