Commit 6dbd8e7f authored by Jean-Paul Saman's avatar Jean-Paul Saman

examples/dvbinfo/libdvbpsi.c: Fix range checking.

parent b557c99c
...@@ -622,10 +622,10 @@ static char const* GetTypeName(uint8_t type) ...@@ -622,10 +622,10 @@ static char const* GetTypeName(uint8_t type)
case 0x1B: return "AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC 14496-10 Video"; case 0x1B: return "AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC 14496-10 Video";
case 0x7F: return "IPMP stream"; case 0x7F: return "IPMP stream";
default: default:
if ((type >= 0x80) && (type <= 0xFF)) if ((type >= 0x1C) && (type <= 0x7E))
return "User Private";
else if ((type >= 0x1C) && (type <= 0x7E))
return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved"; return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved";
else if (type >= 0x80) /* 0x80 - 0xFF */
return "User Private";
else else
return "Unknown"; return "Unknown";
break; break;
...@@ -825,9 +825,8 @@ static void DumpCUEIDescriptor(dvbpsi_cuei_dr_t* p_cuei_descriptor) ...@@ -825,9 +825,8 @@ static void DumpCUEIDescriptor(dvbpsi_cuei_dr_t* p_cuei_descriptor)
if ((p_cuei_descriptor->i_cue_stream_type >= 0x05) && if ((p_cuei_descriptor->i_cue_stream_type >= 0x05) &&
(p_cuei_descriptor->i_cue_stream_type <= 0x7f)) (p_cuei_descriptor->i_cue_stream_type <= 0x7f))
cuei_stream_type = "Reserved"; cuei_stream_type = "Reserved";
else if ((p_cuei_descriptor->i_cue_stream_type >= 0x80) && else if ((p_cuei_descriptor->i_cue_stream_type >= 0x80))
(p_cuei_descriptor->i_cue_stream_type <= 0xff)) cuei_stream_type = "User defined"; /* 0x80 - 0xFF */
cuei_stream_type = "User defined";
break; break;
} }
printf("CUE Identifier stream type: (%0xd) %s\n", printf("CUE Identifier stream type: (%0xd) %s\n",
......
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