Skip to content

Commit

Permalink
Be a bit stricter about range descriptor conformance
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Jackson <ajax@redhat.com>
  • Loading branch information
nwnk committed Aug 17, 2012
1 parent 0a396bb commit 96b3a9f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions edid-decode.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2009 Red Hat, Inc.
* Copyright 2006-2012 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -252,23 +252,27 @@ detailed_block(unsigned char *x, int in_extension)

/*
* despite the values, this is not a bitfield.
* XXX only 0x00 and 0x02 are legal for pre-1.4
*/
switch (x[10]) {
case 0x00: /* default gtf */
range_class = "GTF";
break;
case 0x01: /* range limits only */
range_class = "bare limits";
if (!claims_one_point_four)
has_valid_range_descriptor = 0;
break;
case 0x02: /* secondary gtf curve */
range_class = "GTF with icing";
break;
case 0x04: /* cvt */
range_class = "CVT";
is_cvt = 1;
if (!claims_one_point_four)
has_valid_range_descriptor = 0;
break;
default: /* invalid */
has_valid_range_descriptor = 0;
range_class = "invalid";
break;
}
Expand Down

0 comments on commit 96b3a9f

Please sign in to comment.