read_scaling_list() writes to array pointed by scalingList argument, but the higher level code never initializes ScalingList4x4 and ScalingList8x8 pointer arrays. It leads to unpredictable results like 'segmentation fault' errors or incorrect stream parsing.
In attachment you can find a patch that updates declarations of ScalingList4x4 and ScalingList8x8 fields of sps_t structure. I think that use of static arrays is convenient solution since array sizes are not very large and are fixed by ITU-T H.264.