summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-02 14:19:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-04 03:04:04 +0100
commit7da7d269b8409b2533f4434ab10a197d5726569e (patch)
tree41fd9da50a2bad7ab8bcaa7b6f5c838d593e8287 /ffplay.c
parentf6f1e2b3be8fec0126ca5a87a431e2cc87bcf8e3 (diff)
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 8140dd9645..94c7ed45d1 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -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;