[FFmpeg-devel] [PATCH] avutil: Added selftest for libavutil/audio_fifo.c

Thomas Turner thomastdt at googlemail.com
Thu Dec 22 04:43:20 EET 2016


Yes, you're correct. I'll look over the test and make sure there isn't
anymore bugs before sending in the patch. Thanks

On Dec 21, 2016 6:28 PM, "James Almer" <jamrial at gmail.com> wrote:

On 12/21/2016 11:22 PM, Thomas Turner wrote:
> yeah, currently taking a look.

int tot_elements   = !(planes = av_sample_fmt_is_planar(afifo->sample_fmt))
                     ? samples : afifo->channels * samples;
void **data_planes = allocate_memory(sizeof(void*) * planes);

planes is zero when the sample_fmt is not planar, so you end up
calling malloc(0).
It should be channel count if planar, 1 otherwise. I think you
can just call malloc with afifo->nb_buffers * sizeof(void*) as
size.

This is also a good reason to use av_malloc_array() instead of
a plain malloc().

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list