[FFmpeg-devel] [PATCH] avfilter/showwavespic : case of empty audio stream, fixes ticket 6107
Paul B Mahol
onemda at gmail.com
Sat Jan 28 13:51:34 EET 2017
On 1/28/17, wm4 <nfxjfg at googlemail.com> wrote:
> On Fri, 27 Jan 2017 15:09:28 +0300
> Aleksandr Slobodenyuk <alexander.slobodeniuk at bramtech.ru> wrote:
>
>> From 8d4c7c25674f1967d9ffab69b7ef15381df42ca8 Mon Sep 17 00:00:00 2001
>> From: Aleksandr Slobodeniuk <alenuke at yandex.ru>
>> Date: Fri, 27 Jan 2017 14:57:30 +0300
>> Subject: [PATCH] avfilter/showwavespic : case of empty audio stream, fixes
>> ticket 6107
>>
>> ---
>> libavfilter/avf_showspectrum.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/libavfilter/avf_showspectrum.c
>> b/libavfilter/avf_showspectrum.c
>> index 8776668..b422216 100644
>> --- a/libavfilter/avf_showspectrum.c
>> +++ b/libavfilter/avf_showspectrum.c
>> @@ -1032,6 +1032,11 @@ static int
>> showspectrumpic_request_frame(AVFilterLink *outlink)
>> int ch, spf, spb;
>> AVFrame *fin;
>>
>> + if (samples == 0) {
>> + av_log(ctx, AV_LOG_ERROR, "Too few samples\n");
>> + return AVERROR(EINVAL);
>> + }
>> +
>> spf = s->win_size * (samples / ((s->win_size * sz) * ceil(samples
>> / (float)(s->win_size * sz))));
>> spb = (samples / (spf * sz)) * spf;
>>
>
> Any reason why it should error, instead of returning nothing?
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
Already fixed differently.
More information about the ffmpeg-devel
mailing list