Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab0a02c0 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "BACKPORT: media: venus: hfi_parser: Add check for number of codecs"

parents d9f7a1e1 42db1a1c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,10 @@ static void init_codecs(struct venus_core *core)
	struct venus_caps *caps = core->caps, *cap;
	unsigned long bit;

	if (hweight_long(core->dec_codecs) +
		hweight_long(core->enc_codecs) > MAX_CODEC_NUM)
		return;

	for_each_set_bit(bit, &core->dec_codecs, MAX_CODEC_NUM) {
		cap = &caps[core->codecs_count++];
		cap->codec = BIT(bit);