On Fri, May 01, 2020 at 06:47:54PM +0200, Lynne wrote: > May 1, 2020, 14:16 by mich...@niedermayer.cc: > > > Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > > --- > > libavformat/oggdec.c | 25 +++++++++++++++++-------- > > 1 file changed, 17 insertions(+), 8 deletions(-) > > > > diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c > > index c591bafddd..a9034ea61c 100644 > > --- a/libavformat/oggdec.c > > +++ b/libavformat/oggdec.c > > @@ -297,6 +297,20 @@ static int data_packets_seen(const struct ogg *ogg) > > return 0; > > } > > > > +static int buf_realloc(struct ogg_stream *os, int size) > > +{ > > + /* Even if invalid guarantee there's enough memory to read the page */ > > + if (os->bufsize - os->bufpos < size) { > > + uint8_t *nb = av_realloc(os->buf, 2*os->bufsize + > > AV_INPUT_BUFFER_PADDING_SIZE); > > + if (!nb) > > + return AVERROR(ENOMEM); > > + os->buf = nb; > > + os->bufsize *= 2; > > + } > > > > Looking at the code, this is just av_fast_realloc. > You could change it to that, or you could just allocate MAX_PAGE_SIZE at the > start and never reallocate. Its only 65k. > Up to you, feel free to commit whatever you choose.
The code already allocates 65k at the start so ill apply this so this bug/regression is fixed, we can then change it dont want to leave this bug open until we found the perfect solution thx [...] -- 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.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".