On Sat, Aug 17, 2013 at 07:56:21AM +0200, Luca Barbato wrote:
> Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> CC: [email protected]
> ---
>  libavformat/electronicarts.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
> index e764bd9..baf5535 100644
> --- a/libavformat/electronicarts.c
> +++ b/libavformat/electronicarts.c
> @@ -451,6 +451,12 @@ static int ea_read_header(AVFormatContext *s)
>          return AVERROR(EIO);
>  
>      if (ea->video_codec) {
> +        if (ea->time_base.num <= 0 ||
> +            ea->time_base.den <= 0) {
> +            av_log(s, AV_LOG_WARNING, "Video time base not set, skipping\n");
> +            ea->video_codec = 0;
> +            goto skip_video;
> +        }
>          /* initialize the video decoder stream */
>          st = avformat_new_stream(s, NULL);
>          if (!st)
> @@ -465,7 +471,7 @@ static int ea_read_header(AVFormatContext *s)
>          st->avg_frame_rate     = (AVRational) { ea->time_base.den,
>                                                  ea->time_base.num };
>      }
> -
> +skip_video:
>      if (ea->audio_codec) {
>          if (ea->num_channels <= 0) {
>              av_log(s, AV_LOG_WARNING,
> -- 

I'd leave an empty line between previous block and skip_video but that's a
small nit. In general probably OK.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to