2015-10-04 7:37 GMT+08:00 Michael Niedermayer <[email protected]>: > On Sat, Oct 03, 2015 at 01:14:26AM +0800, Ching-Yi Chan wrote: > > iam not sure changing the format flags is a great idea, i think no > other demuxer does that > that said, the documentation does not say that only the user can > change them so this is more a note that this looks a bit odd not that > it is wrong > > using a context to keep found_seektable state.
> > +
> > + reset_index_position(avio_tell(s->pb), st);
> > return 0;
> >
> > fail:
> > @@ -249,12 +283,33 @@ static av_unused int64_t
> flac_read_timestamp(AVFormatContext *s, int stream_inde
> > return pts;
> > }
> >
> > +static int flac_seek(AVFormatContext *s, int stream_index, int64_t
> timestamp, int flags) {
> > + int index;
> > + int64_t pos;
> > + AVIndexEntry e;
> > + if (!(s->flags&AVFMT_FLAG_FAST_SEEK)) {
> > + return -1;
> > + }
> > +
> > + index = av_index_search_timestamp(s->streams[0], timestamp, flags);
> > + if(index<0 || index >= s->streams[0]->nb_index_entries)
> > + return -1;
> > +
> > + e = s->streams[0]->index_entries[index];
> > + pos = avio_seek(s->pb, e.pos, SEEK_SET);
> > + if (pos >= 0) {
>
> > + return pos;
>
> if pos is larger than INT_MAX the this can overflow and be interpreted
> as an error by the caller
>
>
> fix it by returning 0
0001-avformat-flacdec-support-fast-seek.patch
Description: Binary data
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
