diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-02 14:19:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-04 03:04:04 +0100 |
commit | 7da7d269b8409b2533f4434ab10a197d5726569e (patch) | |
tree | 41fd9da50a2bad7ab8bcaa7b6f5c838d593e8287 /ffplay.c | |
parent | f6f1e2b3be8fec0126ca5a87a431e2cc87bcf8e3 (diff) | |
download | ffmpeg-7da7d269b8409b2533f4434ab10a197d5726569e.tar.gz |
ffplay: Switch to show waves mode if allocation/init of RDFT fails
Fixes null pointer dereference
Found-by: Paweł <pantrombka@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |