This is an automatic generated email to let you know that the following patch 
were queued:

Subject: edid-decode: if offset < 4, then check for non-zero padding
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Thu Oct 26 12:34:24 2023 +0200

There was a check for non-zero padding if offset >= 4, but not
for when it is < 4. Add this.

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 parse-cta-block.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

---

diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index ac337141526c..0a6013c64576 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -2873,8 +2873,15 @@ void edid_state::parse_cta_block(const unsigned char *x)
                        }
                }
 
-               if (offset < 4)
+               if (offset < 4) {
+                       // Offset 0 means that there are no data blocks or DTDs,
+                       // so the remainder must be padding.
+                       if (!memchk(x + 4, 127 - 4)) {
+                               data_block = "Padding";
+                               fail("Contains non-zero bytes.\n");
+                       }
                        break;
+               }
 
                if (version >= 3) {
                        unsigned i;

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to