forked from pool/aubio
31 lines
985 B
Diff
31 lines
985 B
Diff
|
From: Takashi Iwai <tiwai@suse.de>
|
||
|
Subject: Fix a NULl dereference in aubio_source_avcodec_readframe()
|
||
|
References: bsc#1072317 CVE-2017-17554
|
||
|
|
||
|
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||
|
|
||
|
---
|
||
|
src/io/source_avcodec.c | 4 ++++
|
||
|
1 file changed, 4 insertions(+)
|
||
|
|
||
|
--- a/src/io/source_avcodec.c
|
||
|
+++ b/src/io/source_avcodec.c
|
||
|
@@ -420,6 +420,8 @@ void aubio_source_avcodec_readframe(aubi
|
||
|
}
|
||
|
|
||
|
#ifdef HAVE_AVRESAMPLE
|
||
|
+ if (!avr)
|
||
|
+ goto beach;
|
||
|
in_linesize = 0;
|
||
|
av_samples_get_buffer_size(&in_linesize, avCodecCtx->channels,
|
||
|
avFrame->nb_samples, avCodecCtx->sample_fmt, 1);
|
||
|
@@ -430,6 +432,8 @@ void aubio_source_avcodec_readframe(aubi
|
||
|
(uint8_t **)&output, out_linesize, max_out_samples,
|
||
|
(uint8_t **)avFrame->data, in_linesize, in_samples);
|
||
|
#elif defined(HAVE_SWRESAMPLE)
|
||
|
+ if (!avr)
|
||
|
+ goto beach;
|
||
|
in_samples = avFrame->nb_samples;
|
||
|
max_out_samples = AUBIO_AVCODEC_MAX_BUFFER_SIZE / avCodecCtx->channels;
|
||
|
out_samples = swr_convert( avr,
|