aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2014-09-04 14:21:04 +0200
committerTakashi Iwai <tiwai@suse.de>2014-09-04 14:52:04 +0200
commit4b9eafc257dabd9c67de6d3602d027901eaacf21 (patch)
tree7e87d2593b70f25e9fd6ea4684390ed91923d527
parentce40e3f83c4a751fec1607179cad1aae87aaa48f (diff)
downloadhda-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.c5
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;