On Jul 5, 2014 12:02 PM, "Nidhi Makhijani" <[email protected]> wrote:
>
> ---
> changed commit message

It's cdg, not cd.

>  libavformat/cdg.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/cdg.c b/libavformat/cdg.c
> index 974880a..7bcbd16 100644
> --- a/libavformat/cdg.c
> +++ b/libavformat/cdg.c
> @@ -42,9 +42,10 @@ static int read_header(AVFormatContext *s)
>      avpriv_set_pts_info(vst, 32, 1, 300);
>
>      ret = avio_size(s->pb);

> -    if (ret > 0)
> -        vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE *
300);
> +    if (ret < 0)
> +        return AVERROR_INVALIDDATA;

return ret;

Also, you need a special case for ret == 0. Originally, if ret == 0 no
error is reported and it's silently ignored. But I think it warrants an
AVERROR_INVALIDDATA too.

>
> +    vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300);
>      return 0;
>  }
>
> --
> 1.9.1
>
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to