summaryrefslogtreecommitdiff
path: root/libavfilter/asrc_abuffer.c
diff options
context:
space:
mode:
authorClément Bœsch <clement.boesch@smartjog.com>2012-02-15 15:07:09 +0100
committerClément Bœsch <ubitux@gmail.com>2012-02-21 16:45:34 +0100
commit241f8465d07ecc0696bcda994a1f44d836b8809c (patch)
tree99743e86f6c015c80060db2fce2be02b812d126c /libavfilter/asrc_abuffer.c
parenteadd4264ee4319abf9ec2f618ff925d7529f20ed (diff)
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]).
Diffstat (limited to 'libavfilter/asrc_abuffer.c')
-rw-r--r--libavfilter/asrc_abuffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/asrc_abuffer.c b/libavfilter/asrc_abuffer.c
index ad71e12c5b..5eca785f1a 100644
--- a/libavfilter/asrc_abuffer.c
+++ b/libavfilter/asrc_abuffer.c
@@ -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);