diff mbox

[FFmpeg-devel] swresample/resample: do not assert compensation_distance on rebuild_filter

Message ID 20170317010123.25787-1-mfcc64@gmail.com
State Accepted
Commit 3ba7b47d5cb494a0559beb61156eceb17fabf91f
Headers show

Commit Message

Muhammad Faiz March 17, 2017, 1:01 a.m. UTC
when set_compensation is called with zero sample_delta,
compensation does not happen (because dst_incr == ideal_dst_incr)
but compensation_distance is set

regression since 01ebb57c03abde89bca7bdbc552917efcb8f551d

Found-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
---
 libswresample/resample.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

wm4 March 17, 2017, 2:27 a.m. UTC | #1
On Fri, 17 Mar 2017 08:01:23 +0700
Muhammad Faiz <mfcc64@gmail.com> wrote:

> when set_compensation is called with zero sample_delta,
> compensation does not happen (because dst_incr == ideal_dst_incr)
> but compensation_distance is set
> 
> regression since 01ebb57c03abde89bca7bdbc552917efcb8f551d
> 
> Found-by: wm4 <nfxjfg@googlemail.com>
> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
> ---
>  libswresample/resample.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libswresample/resample.c b/libswresample/resample.c
> index 8f3428f..144b232 100644
> --- a/libswresample/resample.c
> +++ b/libswresample/resample.c
> @@ -388,7 +388,7 @@ static int rebuild_filter_bank_with_compensation(ResampleContext *c)
>      if (phase_count == c->phase_count)
>          return 0;
>  
> -    av_assert0(!c->frac && !c->dst_incr_mod && !c->compensation_distance);
> +    av_assert0(!c->frac && !c->dst_incr_mod);
>  
>      new_filter_bank = av_calloc(c->filter_alloc, (phase_count + 1) * c->felem_size);
>      if (!new_filter_bank)

Certainly fixes the crash for me.
Muhammad Faiz March 17, 2017, 3:01 a.m. UTC | #2
On Fri, Mar 17, 2017 at 9:27 AM, wm4 <nfxjfg@googlemail.com> wrote:
> On Fri, 17 Mar 2017 08:01:23 +0700
> Muhammad Faiz <mfcc64@gmail.com> wrote:
>
>> when set_compensation is called with zero sample_delta,
>> compensation does not happen (because dst_incr == ideal_dst_incr)
>> but compensation_distance is set
>>
>> regression since 01ebb57c03abde89bca7bdbc552917efcb8f551d
>>
>> Found-by: wm4 <nfxjfg@googlemail.com>
>> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
>> ---
>>  libswresample/resample.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libswresample/resample.c b/libswresample/resample.c
>> index 8f3428f..144b232 100644
>> --- a/libswresample/resample.c
>> +++ b/libswresample/resample.c
>> @@ -388,7 +388,7 @@ static int rebuild_filter_bank_with_compensation(ResampleContext *c)
>>      if (phase_count == c->phase_count)
>>          return 0;
>>
>> -    av_assert0(!c->frac && !c->dst_incr_mod && !c->compensation_distance);
>> +    av_assert0(!c->frac && !c->dst_incr_mod);
>>
>>      new_filter_bank = av_calloc(c->filter_alloc, (phase_count + 1) * c->felem_size);
>>      if (!new_filter_bank)
>
> Certainly fixes the crash for me.

Applied

Thank's
diff mbox

Patch

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 8f3428f..144b232 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -388,7 +388,7 @@  static int rebuild_filter_bank_with_compensation(ResampleContext *c)
     if (phase_count == c->phase_count)
         return 0;
 
-    av_assert0(!c->frac && !c->dst_incr_mod && !c->compensation_distance);
+    av_assert0(!c->frac && !c->dst_incr_mod);
 
     new_filter_bank = av_calloc(c->filter_alloc, (phase_count + 1) * c->felem_size);
     if (!new_filter_bank)