Fixes dvb-format-convert crashing when encountering an
unrecognised polarization value.

Signed-off-by: Edward Sheldrake <ejsheldr...@gmail.com>
---
 lib/libdvbv5/dvb-file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
index 3fda65f..fc2bebc 100644
--- a/lib/libdvbv5/dvb-file.c
+++ b/lib/libdvbv5/dvb-file.c
@@ -648,8 +648,8 @@ static int fill_entry(struct dvb_entry *entry, char *key, 
char *value)
        else if (!strcasecmp(key, "AUDIO_PID"))
                is_audio = 1;
        else if (!strcasecmp(key, "POLARIZATION")) {
-               for (j = 0; ARRAY_SIZE(dvb_sat_pol_name); j++)
-                       if (!strcasecmp(value, dvb_sat_pol_name[j]))
+               for (j = 0; j < ARRAY_SIZE(dvb_sat_pol_name); j++)
+                       if (dvb_sat_pol_name[j] && !strcasecmp(value, 
dvb_sat_pol_name[j]))
                                break;
                if (j == ARRAY_SIZE(dvb_sat_pol_name))
                        return -2;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to