Commit a0b7103f authored by Christophe Massiot's avatar Christophe Massiot

* dvb/si.h: Fix segfault with malformed text fields.

parent 28fd54b3
...@@ -207,7 +207,7 @@ static inline char *dvb_string_get(const uint8_t *p_string, size_t i_length, ...@@ -207,7 +207,7 @@ static inline char *dvb_string_get(const uint8_t *p_string, size_t i_length,
if (i_length) { if (i_length) {
const char *psz_encoding = dvb_string_get_encoding(&p_string, const char *psz_encoding = dvb_string_get_encoding(&p_string,
&i_length); &i_length);
if (!*psz_encoding || !i_length) { if (psz_encoding == NULL || !i_length) {
/* try one-byte charset */ /* try one-byte charset */
char *psz_string = malloc(i_length + 1); char *psz_string = malloc(i_length + 1);
memcpy(psz_string, p_string, i_length); memcpy(psz_string, p_string, i_length);
......
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