[igt-dev] [PATCH i-g-t 2/3] tools/intel_vbt_decode: Check the number of bytes dumped for the mipi seq operation

Ville Syrjala ville.syrjala at linux.intel.com
Fri Mar 8 14:57:27 UTC 2019


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Cross check the return value from the mipi seq dump function and the
size of the operation declared in the sequence (for v3+ sequence block).

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tools/intel_vbt_decode.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 2c71f0846c15..5742081ea29a 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -1286,7 +1286,14 @@ static const uint8_t *dump_sequence(const uint8_t *data, uint8_t seq_version)
 			operation_size = *data++;
 
 		if (mipi_elem_dump) {
-			data = mipi_elem_dump(data, seq_version);
+			const u8 *next;
+
+			next = mipi_elem_dump(data, seq_version);
+			if (operation_size)
+				data += operation_size;
+			else
+				data = next;
+			assert(next == data);
 		} else if (operation_size) {
 			/* We have size, skip. */
 			data += operation_size;
-- 
2.19.2



More information about the igt-dev mailing list