Line 363 has a clear error with an easy fix, where req.nFrames should be replaced with req.nAvgs.
Line 367 has the data type hardcoded as 12 (Unsigned integer: 16-bit, which seems reasonable), when we expect from data collected with legacy version of Liveview to be 4 (Floating-point: 32-bit single-precision, which does not seem so reasonable). Need to consider this more. See https://www.l3harrisgeospatial.com/docs/enviheaderfiles.html for reference.
Line 368 seems like it should be handled differently, since bit_org is of type org_t which is an enum defined as {fwBIL, fwBIP, fwBSQ} (see https://github.com/nasa-jpl/LiveViewOpenSource/blob/master/include/image_type.h). It is probably working correctly as coded, since fwBIL should return 0 when converted to string. However, in an ENVI header this should be bil. Perhaps create an array of strings and index into this array?