[Ffmpeg-devel] ffplay broken in latest svn

Wolfram Gloger wmglo
Tue Jan 9 11:50:22 CET 2007


Hi,

> --- libavformat/utils.c.orig	Tue Jan  2 22:35:46 2007
> +++ libavformat/utils.c	Tue Jan  9 11:54:36 2007
> @@ -1784,7 +1784,7 @@ int av_find_stream_info(AVFormatContext 
>      AVPacketList *pktl=NULL, **ppktl;
>      int64_t last_dts[MAX_STREAMS];
>      int duration_count[MAX_STREAMS]={0};
> -    double duration_error[MAX_STREAMS][MAX_STD_TIMEBASES]={{0}}; //FIXME malloc()?
> +    double (*duration_error)[MAX_STD_TIMEBASES] = av_mallocz(MAX_STREAMS * MAX_STD_TIMEBASES * sizeof(duration_error));

Ahem, this, without any further pointer initialization, cannot
possibly be correct, the first duration_error[i][j] dereference will
crash, also I think the sizeof(duration_error) (==
MAX_STD_TIME_BASES*sizeof(double*) in this case) is probably
unintentionally large..

I'd suggest double (*duration_error)[MAX_STREAMS] = { 0 };
and lazy pointer initialization..

Regards,
Wolfram.




More information about the ffmpeg-devel mailing list