]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/IdfClassObject.py
BaseTools: add error check for "#image" for idf file format
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / IdfClassObject.py
index 76bc6d1b931e45e936ba414a3bb52269dba4dbf6..d6d4703370aa79507426afffca5bb2c554ef1070 100644 (file)
@@ -94,9 +94,12 @@ class IdfFileClassObject(object):
             if len(Line) == 0:\r
                 continue\r
 \r
+            LineNo = GetLineNo(FileIn, Line, False)\r
+            if not Line.startswith('#image '):\r
+                EdkLogger.error("Image Definition File Parser", PARSER_ERROR, 'The %s in Line %s of File %s is invalid.' % (Line, LineNo, File.Path))\r
+\r
             if Line.find('#image ') >= 0:\r
                 LineDetails = Line.split()\r
-                LineNo = GetLineNo(FileIn, Line, False)\r
                 Len = len(LineDetails)\r
                 if Len != 3 and Len != 4:\r
                     EdkLogger.error("Image Definition File Parser", PARSER_ERROR, 'The format is not match #image IMAGE_ID [TRANSPARENT] ImageFileName in Line %s of File %s.' % (LineNo, File.Path))\r