]> wimlib.net Git - wimlib/commit
read_stream_list(): Spill huge data ranges array onto heap
authorEric Biggers <ebiggers3@gmail.com>
Tue, 7 Jan 2014 19:20:38 +0000 (13:20 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 7 Jan 2014 19:27:16 +0000 (13:27 -0600)
commit6ec05488c1ca6d629a560ba8efadd30418ae1493
tree682581839bfa3f31d01498a0c2aa7c3b2d977ef9
parenta413b8ad79e7c7b19e0abe4fa855c1e92f99cf46
read_stream_list():  Spill huge data ranges array onto heap

There can be thousands of streams packed into a single resource, so it's
a good idea to check if the data_ranges array is really small enough to
be allocated on the stack or not, and if not, allocate it on the heap
instead.

For readability and to create a temporary frame for alloca(), place the
relevant code in a new function read_packed_streams().
src/resource.c