mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 03:46:11 +00:00
sys/dvb/camutils.c: Extra checks to prevent data corruption/segfaults.
Original commit message from CVS: * sys/dvb/camutils.c: Extra checks to prevent data corruption/segfaults.
This commit is contained in:
parent
67e9c433df
commit
4bf32cac7a
2 changed files with 22 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-02-27 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
|
* sys/dvb/camutils.c:
|
||||||
|
Extra checks to prevent data corruption/segfaults.
|
||||||
|
|
||||||
2008-02-26 Stefan Kost <ensonic@users.sf.net>
|
2008-02-26 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* ext/nas/nassink.c:
|
* ext/nas/nassink.c:
|
||||||
|
|
|
@ -232,12 +232,14 @@ cam_build_ca_pmt (GstStructure * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
streams = gst_structure_get_value (pmt, "streams");
|
streams = gst_structure_get_value (pmt, "streams");
|
||||||
value = gst_structure_get_value (pmt, "descriptors");
|
value = gst_structure_get_value (pmt, "descriptors");
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
program_descriptors = g_value_get_boxed (value);
|
if (G_VALUE_HOLDS_BOXED (value)) {
|
||||||
/* get the length of program level CA_descriptor()s */
|
program_descriptors = g_value_get_boxed (value);
|
||||||
len = get_ca_descriptors_length (program_descriptors);
|
/* get the length of program level CA_descriptor()s */
|
||||||
if (len > 0)
|
len = get_ca_descriptors_length (program_descriptors);
|
||||||
/* add one byte for the program level cmd_id */
|
if (len > 0)
|
||||||
len += 1;
|
/* add one byte for the program level cmd_id */
|
||||||
|
len += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lengths = g_list_append (lengths, GINT_TO_POINTER (len));
|
lengths = g_list_append (lengths, GINT_TO_POINTER (len));
|
||||||
body_size += 6 + len;
|
body_size += 6 + len;
|
||||||
|
@ -249,12 +251,16 @@ cam_build_ca_pmt (GstStructure * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
stream = g_value_get_boxed (value);
|
stream = g_value_get_boxed (value);
|
||||||
|
|
||||||
value = gst_structure_get_value (stream, "descriptors");
|
value = gst_structure_get_value (stream, "descriptors");
|
||||||
stream_descriptors = g_value_get_boxed (value);
|
if (value != NULL) {
|
||||||
|
if (G_VALUE_HOLDS_BOXED (value)) {
|
||||||
|
stream_descriptors = g_value_get_boxed (value);
|
||||||
|
|
||||||
len = get_ca_descriptors_length (stream_descriptors);
|
len = get_ca_descriptors_length (stream_descriptors);
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
/* one byte for the stream level cmd_id */
|
/* one byte for the stream level cmd_id */
|
||||||
len += 1;
|
len += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lengths = g_list_append (lengths, GINT_TO_POINTER (len));
|
lengths = g_list_append (lengths, GINT_TO_POINTER (len));
|
||||||
body_size += 5 + len;
|
body_size += 5 + len;
|
||||||
|
|
Loading…
Reference in a new issue