[PATCH] libdvbv5: fix the count of partial receptions

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

 



Currently the number of elements are counted wrong, its divided by the size
of a pointer and not the size of the struct
isdb_desc_partial_reception (uint16_t).

I noticed this when using "dvbv5-scan -v" in order to debug an ISDB-T table.

Signed-off-by: Felipe Concha Avello <felipec84@xxxxxxxxx>
---
diff --git a/lib/libdvbv5/descriptors/desc_partial_reception.c
b/lib/libdvbv5/descriptors/desc_partial_reception.c
index ce40882..63b8a07 100644
--- a/lib/libdvbv5/descriptors/desc_partial_reception.c
+++ b/lib/libdvbv5/descriptors/desc_partial_reception.c
@@ -38,7 +38,7 @@ int isdb_desc_partial_reception_init(struct
dvb_v5_fe_parms *parms,

        memcpy(d->partial_reception, p, d->length);

-       len = d->length / sizeof(d->partial_reception);
+       len = d->length / sizeof(*d->partial_reception);

        for (i = 0; i < len; i++)
                bswap16(d->partial_reception[i].service_id);
@@ -58,7 +58,7 @@ void isdb_desc_partial_reception_print(struct
dvb_v5_fe_parms *parms, const stru
        int i;
        size_t len;

-       len = d->length / sizeof(d->partial_reception);
+       len = d->length / sizeof(*d->partial_reception);

        for (i = 0; i < len; i++) {
                dvb_loginfo("|           service ID[%d]     %d", i,
d->partial_reception[i].service_id);
diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
index 1ffb98a..38f558b 100644
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -905,7 +905,7 @@ static void add_update_nit_1seg(struct dvb_table_nit *nit,
        if (!tr->update)
                return;

-       len = d->length / sizeof(d->partial_reception);
+       len = d->length / sizeof(*d->partial_reception);

        for (i = 0; i < len; i++) {
                if (tr->entry->service_id ==
d->partial_reception[i].service_id) {
--
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