[FFmpeg-devel] [PATCH 07/28] changed: check return value of seeks to avoid messing up current stream location

Reimar Döffinger Reimar.Doeffinger
Wed Jun 30 18:36:14 CEST 2010


On Wed, Jun 30, 2010 at 10:09:35AM +0100, Mans Rullgard wrote:
> From: Cory Fields <theuni-nospam- at xbmc.org>
> 
> ---
>  libavformat/avidec.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> index befaa79..390d42f 100644
> --- a/libavformat/avidec.c
> +++ b/libavformat/avidec.c
> @@ -190,7 +190,10 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
>  
>              pos = url_ftell(pb);
>  
> -            url_fseek(pb, offset+8, SEEK_SET);
> +            if(url_fseek(pb, pos, SEEK_SET) < 0) {
> +                av_log(s, AV_LOG_ERROR, "Failed to restore position after reading index");
> +                return -1;
> +            }

when/why does this make a difference?

>              read_braindead_odml_indx(s, frame_num);

Hmm... an arbitrarily recursive function?
At least a DoS on that seems trivial... (I suspect this is not
the only place this can happen, IIRC mov allows something similar
by putting moov into moov into moov...).



More information about the ffmpeg-devel mailing list