[FFmpeg-cvslog] ffplay: Switch to show waves mode if allocation/init of RDFT fails
Michael Niedermayer
git at videolan.org
Wed Mar 4 03:17:32 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Mar 2 14:19:41 2015 +0100| [7da7d269b8409b2533f4434ab10a197d5726569e] | committer: Michael Niedermayer
ffplay: Switch to show waves mode if allocation/init of RDFT fails
Fixes null pointer dereference
Found-by: Paweł <pantrombka at gmail.com>
Reviewed-by: Marton Balint <cus at passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7da7d269b8409b2533f4434ab10a197d5726569e
---
ffplay.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ffplay.c b/ffplay.c
index 8140dd9..94c7ed4 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;
More information about the ffmpeg-cvslog
mailing list