[FFmpeg-devel] [PATCH] [matroska] Check return value of avio_seek and avoid modifying state if it fails

Michael Niedermayer michaelni at gmx.at
Wed Sep 14 20:48:01 CEST 2011


On Wed, Sep 14, 2011 at 08:12:06PM +0200, Joakim Plate wrote:
> ---
>  libavformat/matroskadec.c |   24 ++++++++++++++----------
>  1 files changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index 3a5940b..7564c2d 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -2018,25 +2018,20 @@ static int matroska_read_seek(AVFormatContext
> *s, int stream_index,
>      timestamp = FFMAX(timestamp, st->index_entries[0].timestamp);
> 
>      if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
> -        avio_seek(s->pb,
> st->index_entries[st->nb_index_entries-1].pos, SEEK_SET);
> +        if (avio_seek(s->pb,
> st->index_entries[st->nb_index_entries-1].pos, SEEK_SET) < 0)
> +            return -1;
>          matroska->current_id = 0;
>          while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {

it seems this diff was word wraped
this reminds me of tools/unwrap-diff :)

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110914/c2af0094/attachment.asc>


More information about the ffmpeg-devel mailing list