summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2020-08-08 21:30:14 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-08-11 11:21:47 -0700
commita59baf862ce3df1fd044a2f455dbaf1f9ff729c9 (patch)
tree841a7c15a4d779fd91afd4bf0b8a811fbac32ce8
parentc6df585d420a34c7c29b09c92f4be50f8aa9ecd1 (diff)
downloadsbc-a59baf862ce3df1fd044a2f455dbaf1f9ff729c9.tar.gz
sbcenc: Add missing error check for unsupported sample rates
-rw-r--r--src/sbcenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sbcenc.c b/src/sbcenc.c
index dabdff4..2a4c240 100644
--- a/src/sbcenc.c
+++ b/src/sbcenc.c
@@ -105,6 +105,10 @@ static void encode(char *filename, int subbands, int bitpool, int joint,
case 48000:
sbc.frequency = SBC_FREQ_48000;
break;
+ default:
+ fprintf(stderr, "Unsupported sample rate %ukHz\n",
+ BE_INT(au_hdr.sample_rate));
+ goto done;
}
srate = BE_INT(au_hdr.sample_rate);