Message ID | 20170707095447.29367-1-hexptr@gmx.com |
---|---|
State | Accepted |
Commit | 3fa8f263abf90650b62d43cb532cdb8cc5bd7c13 |
Headers | show |
On Fri, Jul 07, 2017 at 10:54:47AM +0100, hexpointer wrote: > When 'out' is an AVFrame that does not have buffers preallocated, > swr_convert_frame tries to allocate buffers of the right size. However > in calculating this size it failed to check for whether 'in' is NULL > (requesting that swr's internal buffers are to be flushed). > --- > libswresample/swresample_frame.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) Is the author value as intended ? "Author: hexpointer <hexptr@gmx.com>" Theres no name (it cannot be changed after pushing) [...]
> Sent: Saturday, July 08, 2017 at 2:19 AM > From: "Michael Niedermayer" <michael@niedermayer.cc> > To: "FFmpeg development discussions and patches" <ffmpeg-devel@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH] libswresample: check input to swr_convert_frame for NULL > > Is the author value as intended ? > "Author: hexpointer <hexptr@gmx.com>" > Theres no name > > (it cannot be changed after pushing) Yes. Pseudonym only please.
On Sat, Jul 08, 2017 at 03:56:53PM +0200, hexpointer wrote: > > Sent: Saturday, July 08, 2017 at 2:19 AM > > From: "Michael Niedermayer" <michael@niedermayer.cc> > > To: "FFmpeg development discussions and patches" <ffmpeg-devel@ffmpeg.org> > > Subject: Re: [FFmpeg-devel] [PATCH] libswresample: check input to swr_convert_frame for NULL > > > > Is the author value as intended ? > > "Author: hexpointer <hexptr@gmx.com>" > > Theres no name > > > > (it cannot be changed after pushing) > > Yes. Pseudonym only please. ok, applied thx [...]
diff --git a/libswresample/swresample_frame.c b/libswresample/swresample_frame.c index 71d3ed711a..2853266d6c 100644 --- a/libswresample/swresample_frame.c +++ b/libswresample/swresample_frame.c @@ -139,9 +139,10 @@ int swr_convert_frame(SwrContext *s, if (out) { if (!out->linesize[0]) { - out->nb_samples = swr_get_delay(s, s->out_sample_rate) - + in->nb_samples*(int64_t)s->out_sample_rate / s->in_sample_rate - + 3; + out->nb_samples = swr_get_delay(s, s->out_sample_rate) + 3; + if (in) { + out->nb_samples += in->nb_samples*(int64_t)s->out_sample_rate / s->in_sample_rate; + } if ((ret = av_frame_get_buffer(out, 0)) < 0) { if (setup) swr_close(s);