[FFmpeg-devel] [PATCH] ffplay: Switch to show waves mode if allocation/init of RDFT fails

Michael Niedermayer michaelni at gmx.at
Wed Mar 4 03:16:30 CET 2015


On Wed, Mar 04, 2015 at 01:35:10AM +0100, Marton Balint wrote:
> 
> On Mon, 2 Mar 2015, Michael Niedermayer wrote:
> 
> >Fixes null pointer dereference
> >
> >Found-by: Paweł <pantrombka at gmail.com>
> >Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> >---
> >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;
> >-- 
> >1.7.9.5
> 
> LGTM, thanks.

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150304/8ccdf0d2/attachment.asc>


More information about the ffmpeg-devel mailing list