When decoding LPC subframes using libFLAC (FLAC__lpc_restore_signal) a shift operation with a potentially negative right operand (lp_quantization) is done. The C standard states that in this case the behavior is undefined. There might not be any files having negative values or platforms doing what is expected, still this isn't fully correct.
How did you find this? Was it using some tool? If so, which one and what was the full message? Or is there an example file that triggers this?
I'm implementing a decoder on a soft core processor using libFLAC as reference.
There is no specific problem and I couldn't find a file with a negative value.
FLAC format
ISO/IEC 9899:1999 6.5.7.3
The point is that libFLAC uses a statement that has undefined behavior and it's result depends on compiler and platform. Some might shift in opposite direction others will just interpret as unsigned.
During encoding, the value of lp_quantization is calculated by FLAC__lpc_quantize_coefficients() function in lpc.c.
This function makes sure that it is always non-negative. Also, there's a comment in it:
Added: but it seems that ffmpeg verifies its value on decoding:
Added2: IMHO it should be mentioned in FLAC docs that its value MUST be non-negative.
Last edit: lvqcl 2015-01-21