Commit bc596c90 authored by mukai@chromium.org's avatar mukai@chromium.org

Fix silly bugs around overscan flag detection.

- we want to check a data block of a specific tag and enough length,
  which doesn't mean && here.
- data_block skipping length is different between two continue

BUG=226318
TEST=ui_unittests passed


Review URL: https://chromiumcodereview.appspot.com/13648004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192497 0039d316-1c4b-4281-b951-d872f2087c98
parent c335137a
......@@ -1443,14 +1443,14 @@ bool ParseOutputOverscanFlag(const unsigned char* prop,
nitems)
break;
if (tag != kExtendedTag && payload_length < 2) {
if (tag != kExtendedTag || payload_length < 2) {
data_block += payload_length + 1;
continue;
}
unsigned char extended_tag_code = data_block[1];
if (extended_tag_code != kExtendedVideoCapabilityTag) {
data_block += payload_length;
data_block += payload_length + 1;
continue;
}
......
......@@ -54,6 +54,25 @@ const unsigned char kOverscanDisplay[] =
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6";
// The EDID info misdetecting overscan once. see crbug.com/226318
const unsigned char kMisdetecedDisplay[] =
"\x00\xff\xff\xff\xff\xff\xff\x00\x10\xac\x64\x40\x4c\x30\x30\x32"
"\x0c\x15\x01\x03\x80\x40\x28\x78\xea\x8d\x85\xad\x4f\x35\xb1\x25"
"\x0e\x50\x54\xa5\x4b\x00\x71\x4f\x81\x00\x81\x80\xd1\x00\xa9\x40"
"\x01\x01\x01\x01\x01\x01\x28\x3c\x80\xa0\x70\xb0\x23\x40\x30\x20"
"\x36\x00\x81\x91\x21\x00\x00\x1a\x00\x00\x00\xff\x00\x50\x48\x35"
"\x4e\x59\x31\x33\x4e\x32\x30\x30\x4c\x0a\x00\x00\x00\xfc\x00\x44"
"\x45\x4c\x4c\x20\x55\x33\x30\x31\x31\x0a\x20\x20\x00\x00\x00\xfd"
"\x00\x31\x56\x1d\x5e\x12\x00\x0a\x20\x20\x20\x20\x20\x20\x01\x38"
"\x02\x03\x29\xf1\x50\x90\x05\x04\x03\x02\x07\x16\x01\x06\x11\x12"
"\x15\x13\x14\x1f\x20\x23\x0d\x7f\x07\x83\x0f\x00\x00\x67\x03\x0c"
"\x00\x10\x00\x38\x2d\xe3\x05\x03\x01\x02\x3a\x80\x18\x71\x38\x2d"
"\x40\x58\x2c\x45\x00\x81\x91\x21\x00\x00\x1e\x01\x1d\x80\x18\x71"
"\x1c\x16\x20\x58\x2c\x25\x00\x81\x91\x21\x00\x00\x9e\x01\x1d\x00"
"\x72\x51\xd0\x1e\x20\x6e\x28\x55\x00\x81\x91\x21\x00\x00\x1e\x8c"
"\x0a\xd0\x8a\x20\xe0\x2d\x10\x10\x3e\x96\x00\x81\x91\x21\x00\x00"
"\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x94";
}
TEST(X11UtilTest, ParseEDID) {
......@@ -141,6 +160,10 @@ TEST(X11UtilTest, ParseOverscanFlag) {
kOverscanDisplay, charsize(kOverscanDisplay), &flag));
EXPECT_TRUE(flag);
flag = false;
EXPECT_FALSE(ParseOutputOverscanFlag(
kMisdetecedDisplay, charsize(kMisdetecedDisplay), &flag));
flag = false;
// Copy |kOverscanDisplay| and set flags to false in it. The overscan flags
// are embedded at byte 150 in this specific example. Fix here too when the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment