1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavfi/abuffer: init the data planes with NULL pointers.

Samples buffer ref is allocated and loaded with the uninitialized data
pointers:
     av_asrc_buffer_add_buffer()
  -> av_asrc_buffer_add_samples()
  -> avfilter_get_audio_buffer_ref_from_arrays(data, ...)

...which leads to a crash with at least lavfi/ashowinfo in case of !NULL
(see the for loop while samplesref->data[plane]).
This commit is contained in:
Clément Bœsch 2012-02-15 15:07:09 +01:00 committed by Clément Bœsch
parent eadd4264ee
commit 241f8465d0

View File

@ -234,7 +234,7 @@ int av_asrc_buffer_add_buffer(AVFilterContext *ctx,
int sample_fmt, int64_t channel_layout, int planar,
int64_t pts, int av_unused flags)
{
uint8_t *data[8];
uint8_t *data[8] = {0};
int linesize[8];
int nb_channels = av_get_channel_layout_nb_channels(channel_layout),
nb_samples = buf_size / nb_channels / av_get_bytes_per_sample(sample_fmt);