While reviewing this I did explore the idea of fixing the color key check without moving it to the source format. I'm attaching the result of that here, for reference.
It's a bunch of debug stuff, test changes, fixes to the color key checks which kinda required splitting up the rgb_range into individual per-component ranges. It's not exactly beautiful or thought out (e.g. I more or less blindly replaced rgb_range with r_range all over the place, which isn't necessarily correct), but I guess it might be somewhat useful.
[d3dx-per-channel-range.txt](/uploads/7398e770a0f207ef0799b586ec79334d/d3dx-per-channel-range.txt)