Commit 7da7d269 authored by Michael Niedermayer's avatar Michael Niedermayer

ffplay: Switch to show waves mode if allocation/init of RDFT fails

Fixes null pointer dereference
Found-by: 's avatarPaweł <pantrombka@gmail.com>
Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f6f1e2b3
......@@ -1247,7 +1247,10 @@ static void video_audio_display(VideoState *s)
s->rdft_bits = rdft_bits;
s->rdft_data = av_malloc_array(nb_freq, 4 *sizeof(*s->rdft_data));
}
{
if (!s->rdft || !s->rdft_data){
av_log(NULL, AV_LOG_ERROR, "Failed to allocate buffers for RDFT, switching to waves display\n");
s->show_mode = SHOW_MODE_WAVES;
} else {
FFTSample *data[2];
for (ch = 0; ch < nb_display_channels; ch++) {
data[ch] = s->rdft_data + 2 * nb_freq * ch;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment