[FFmpeg-devel] [PATCH] avformat/avisynth simplify packet allocation

Michael Niedermayer michaelni at gmx.at
Fri Jan 10 02:08:10 CET 2014


On Thu, Jan 09, 2014 at 03:53:48PM -0800, Timothy Gu wrote:
> On Jan 9, 2014 10:35 AM, "Michael Niedermayer" <michaelni at gmx.at> wrote:
> >
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavformat/avisynth.c |   38 ++++++++++++++------------------------
> >  1 file changed, 14 insertions(+), 24 deletions(-)
> >
> > diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
> > index 99fe34c..b837bd9 100644
> > --- a/libavformat/avisynth.c
> > +++ b/libavformat/avisynth.c
> > @@ -401,10 +401,10 @@ static void avisynth_next_stream(AVFormatContext
> *s, AVStream **st,
> >  {
> >      AviSynthContext *avs = s->priv_data;
> >
> 
> > -    pkt->stream_index = avs->curr_stream++;
> > +    avs->curr_stream++;
> 
> [...]
> 
> > -    *st = s->streams[pkt->stream_index];
> > +    *st = s->streams[avs->curr_stream];
> 
> Shouldn't it be curr_stream - 1?

no, curr_stream can be 0 so -1 would be out of array

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20140110/7891670e/attachment.asc>


More information about the ffmpeg-devel mailing list