[FFmpeg-devel] [PATCH 07/28] changed: check return value of seeks to avoid messing up current stream location
Michael Niedermayer
michaelni
Thu Jul 1 01:58:37 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;
> + }
> read_braindead_odml_indx(s, frame_num);
after?
this is before read_braindead_odml_indx()
so rather "failure to seek to odml index chunk at X maybe truncated file or unseekable input?"
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- 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/0610036d/attachment.pgp>
More information about the ffmpeg-devel
mailing list