]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
[udp_send] Refuse to stream files with invalid chunk tables.
authorAndre Noll <maan@systemlinux.org>
Thu, 23 Apr 2009 15:18:03 +0000 (17:18 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 23 Apr 2009 15:18:03 +0000 (17:18 +0200)
If an audio file contains a chunk so large that even the maximal
possible number of slices is not sufficient to put this chunk into
a single FEC group, we must refuse to send this file. It's likely a
corrupt file anyway.

The old code in num_slices() was buggy as it returned the number of
slices needed to send the file as an uint8_t, so the return value
was actually the number of needed slices mod 256. This could trigger
the assert() in setup_next_fec_group() which checks that the group
contains at least one chunk.

This patch changes num_slices() to detect this situation more
reliably. As it is likely caused by a bad audio file rather than by a
networking problem, we do _not_ kick the fec client, but deactivate
it for the current file only. This requires the new "error" member
of struct fec_client which indicates a temporarily disabled fec client.


No differences found