sbc: don't dereference sbc pointer if NULL
PATCH 1/1 sbc: don't dereference sbc pointer if NULL
From: Marc-André Lureau <[email protected]>
--- sbc/sbc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
sbc/sbc.c +2 -2
@@ -985,7 +985,7 @@ int sbc_decode(sbc_t *sbc, void *input, int input_len, void *output,char *ptr;int i, ch, framelen, samples; -if (!sbc && !input) +if (!sbc || !input)return -EIO ; priv = sbc->priv;
@@ -1053,7 +1053,7 @@ int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output, const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE], int nsamples, int nchannels); -if (!sbc && !input) +if (!sbc || !input)return -EIO ; priv = sbc->priv;
Signature · 1 line
1.6.1.224.gb56c
Quoted 14 lines · On Tue, Feb 17, 2009, [email protected] wrote:
sbc/sbc.c +1
-1@@ -985,7 +985,7 @@ int sbc_decode(sbc_t *sbc, void *input, int input_len, void *output,char *ptr;int i, ch, framelen, samples; -if (!sbc && !input) +if (!sbc || !input)return -EIO ; priv = sbc->priv;
sbc/sbc.c int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output, · line 1059
Quoted 8 lines
sbc/sbc.c +1
-1@@ -1053,7 +1053,7 @@ int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output, const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE], int nsamples, int nchannels); -if (!sbc && !input) +if (!sbc || !input)return -EIO ; priv = sbc->priv;
This one's now also pushed upstream.
Johan