diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-09-04 14:21:04 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-09-04 14:52:04 +0200 |
commit | 4b9eafc257dabd9c67de6d3602d027901eaacf21 (patch) | |
tree | 7e87d2593b70f25e9fd6ea4684390ed91923d527 | |
parent | ce40e3f83c4a751fec1607179cad1aae87aaa48f (diff) | |
download | hda-emu-4b9eafc257dabd9c67de6d3602d027901eaacf21.tar.gz |
hda-emu: Quit early if requested codec index is above limit
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | hda-parse.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hda-parse.c b/hda-parse.c index d9fc311..57e9ee3 100644 --- a/hda-parse.c +++ b/hda-parse.c @@ -687,6 +687,11 @@ int parse_codec_proc(FILE *fp, struct xhda_codec *codecp, int codec_index) } } + if (curidx < codec_index) { + hda_log(HDA_LOG_ERR, "Codec index %d requested, but found only %d codecs\n", codec_index, curidx+1); + return -ENODEV; + } + add_codec_extensions(codec); return 0; |