brand[1] = ((data[0] & 0x3) << 3) + (data[1] >> 5);
brand[2] = data[1] & 0x1f;
+ if (((brand[0] > 26) || (brand[0] == 0))
+ || ((brand[1] > 26) || (brand[1] == 0))
+ || ((brand[2] > 26) || (brand[2] == 0)))
+ return;
for (i = 0; i < 3; i++)
pRxCap->IDManufacturerName[i] = uppercase[brand[i] - 1];
}
ssize_t store_attr(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
- memcpy(hdmitx_device.fmt_attr, buf, sizeof(hdmitx_device.fmt_attr));
+ strncpy(hdmitx_device.fmt_attr, buf, sizeof(hdmitx_device.fmt_attr));
+ hdmitx_device.fmt_attr[15] = '\0';
return count;
}
/*aud_mode attr*/
int pos = 0;
unsigned int i, j;
struct rx_cap *pRXCap = &(hdmitx_device.RXCap);
+
pos += snprintf(buf + pos, PAGE_SIZE, "HDR Static Metadata:\n");
pos += snprintf(buf + pos, PAGE_SIZE, " Supported EOTF:\n");
pos += snprintf(buf + pos, PAGE_SIZE, " Traditional SDR: %d\n",
{
struct vinfo_s *info = hdmitx_get_current_vinfo();
unsigned int i;
+
if (info) {
info->hdr_info.hdr_support = 0;
for (i = 0; i < 4; i++)