[FFmpeg-devel] [PATCH 19/28] changed: check some more url_fseeks in asf demuxer to avoid problems if file system is unseekable

Michael Niedermayer michaelni
Thu Jul 1 03:08:04 CEST 2010


On Wed, Jun 30, 2010 at 10:09:47AM +0100, Mans Rullgard wrote:
> From: Cory Fields <theuni-nospam- at xbmc.org>
> 
> ---
>  libavformat/asfdec.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index 40ed9ed..47d6f62 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -1068,7 +1068,8 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
>      if (s->packet_size > 0)
>          pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset;
>      *ppos= pos;
> -    url_fseek(s->pb, pos, SEEK_SET);
> +    if (url_fseek(s->pb, pos, SEEK_SET) < 0)
> +        return AV_NOPTS_VALUE;
>  
>  //printf("asf_read_pts\n");
>      asf_reset_header(s);

this hunk may be ok


> @@ -1110,7 +1111,11 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
>      int64_t current_pos= url_ftell(s->pb);
>      int i;
>  
> -    url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
> +    if(url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET) < 0) {
> +      asf->index_read= -1;
> +      return;
> +    }

setting index_read looks broken

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100701/08071aad/attachment.pgp>



More information about the ffmpeg-devel mailing list