[PATCH] libdvbv5: Fix dvb-format-convert segfault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Edward Sheldrake <ejsheldrake@xxxxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux