Hi, On Fri, Jul 1, 2011 at 9:43 AM, Alex Converse <[email protected]> wrote: > On Wed, Jun 29, 2011 at 3:44 PM, Ronald S. Bultje <[email protected]> wrote: >> From: Chris Evans <[email protected]> >> >> Specifically crafted samples can reinit ogg->streams[] while >> reading samples, and thus we should not cache old pointers since >> these may no longer be valid. >> >> Signed-off-by: Ronald S. Bultje <[email protected]> >> --- >> libavformat/oggdec.c | 5 +++-- >> 1 files changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c >> index 998a33b..931a826 100644 >> --- a/libavformat/oggdec.c >> +++ b/libavformat/oggdec.c >> @@ -586,15 +586,15 @@ static int64_t ogg_read_timestamp(AVFormatContext *s, >> int stream_index, >> int64_t *pos_arg, int64_t pos_limit) >> { >> struct ogg *ogg = s->priv_data; >> - struct ogg_stream *os = ogg->streams + stream_index; >> AVIOContext *bc = s->pb; >> int64_t pts = AV_NOPTS_VALUE; >> - int i; >> + int i = -1; > > Perhaps it would amek sense to have ogg_packets() always set str (i)?
Looking at it, it's not that simple. idx being untouched is also relied on in e.g. ogg_read_packet(), where that is actually used as a way of communicating that we're not yet done reading headers... It's probably easier to continue that logic here, rather than change it and risk breaking it. I'm not familiar enough with the code to do that... Ronald _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
