libFLAC/format.c: Fix undefined behaviour
authorErik de Castro Lopo <erikd@mega-nerd.com>
Wed, 26 Aug 2015 07:13:39 +0000 (17:13 +1000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Wed, 26 Aug 2015 07:21:36 +0000 (17:21 +1000)
commita14581642c9e7dcee15d05bde9fd0a6a47350dcc
tree9eb612b4fb6c156335cbf4155834abf902719cd2
parentfb273e469e358994034e79e882192ac5eb7c9d48
libFLAC/format.c: Fix undefined behaviour

In the case where seek_table->num_points is zero, seek_table->points
will be NULL and passing that to qsort() invokes undefined behaviour.

Since seek_table->num_points is zero, the only sensible thing to do
is to short circuit return 0.
src/libFLAC/format.c