]> git.tuebingen.mpg.de Git - paraslash.git/commit
[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)
commita2872df1d181fe8ed736fcf2bda09134c380d5d2
tree340a67991918ac1cdf053d4e1a7c72bfe854fe34
parent86190b3a6a52624884f62ef4f8dca83f4f95597a
[udp_send] Refuse to stream files with invalid chunk tables.

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.
error.h
vss.c