Re: [PATCH 3/3] android/audio_utils/resampler : Fix the null pointer dereference.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Sep 5, 2014 at 5:12 PM, gowtham babu <gowtham.ab@xxxxxxxxxxx> wrote:
> Checks for NULL.
> ---
>  android/audio_utils/resampler.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/android/audio_utils/resampler.c b/android/audio_utils/resampler.c
> index ce30375..f845e2c 100644
> --- a/android/audio_utils/resampler.c
> +++ b/android/audio_utils/resampler.c
> @@ -50,8 +50,10 @@ static void resampler_reset(struct resampler_itfe *resampler)
>  {
>      struct resampler *rsmp = (struct resampler *)resampler;
>
> -    rsmp->frames_in = 0;
> -    rsmp->frames_rq = 0;
> +    if(rsmp != NULL) {
> +       rsmp->frames_in = 0;
> +       rsmp->frames_rq = 0;
> +    }
>
>      if (rsmp != NULL && rsmp->speex_resampler != NULL) {
>          speex_resampler_reset_mem(rsmp->speex_resampler);
> --
> 1.9.1

Im afraid this was copied from Android so I would not bother with it
except if you want to send the patch to Android itself.


-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux