diff options
| author | 2005-07-04 03:00:50 +0000 | |
|---|---|---|
| committer | 2005-07-04 03:00:50 +0000 | |
| commit | 19065515152718407db849b0be71a8eeee80deaa (patch) | |
| tree | 53aaf9dba643e8967d02a5b5509f2b4a1d4ca416 /src/iso.c | |
| parent | Add a comment that libraw does not allocate channels and bandwidth. This (diff) | |
add sanity check to queuing of packets in rawiso xmit
git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@159 53a565d1-3bb7-0310-b661-cf11e63c67ab
Diffstat (limited to 'src/iso.c')
| -rw-r--r-- | src/iso.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -269,7 +269,6 @@ int raw1394_iso_recv_start(raw1394handle_t handle, int start_on_cycle, int tag_m return 0; } - static int _raw1394_iso_xmit_queue_packets(raw1394handle_t handle) { struct raw1394_iso_status *stat = &handle->iso_status; @@ -282,6 +281,10 @@ static int _raw1394_iso_xmit_queue_packets(raw1394handle_t handle) goto out; } + /* ensure stat->n_packets is sane */ + if (stat->n_packets > stat->config.buf_packets) + stat->n_packets = stat->config.buf_packets; + /* we could potentially send up to stat->n_packets packets */ packets.n_packets = 0; packets.infos = malloc(stat->n_packets * sizeof(struct raw1394_iso_packet_info)); |
