Fix #1117: potential encoder/decoder mismatch
fix a condition under which the encoder could write a syntax element which would not be present at the decoder
fix a condition under which the encoder could write a syntax element which would not be present at the decoder