schwehr / libais

C++ decoder for Automatic Identification System for tracking ships and decoding maritime information
Other
218 stars 97 forks source link

Ais6_1_4 message is always parsed incorrectly. (Crash) #139

Open mb12 opened 8 years ago

mb12 commented 8 years ago

@schwehr Can you please comment if it is safe (or not) to uncomment the line that parses spare2? Or should we change the assert to bs.GetRemaining() == 0 || bs.GetRemaining() ==6. This is okay only if application does not use spare2.

The following string consistently reproduces it. "!AIVDM,1,1,,A,64R:gF00UBf004@0@2000020000002000000000,2*18"

  // spare2 = bs.ToUnsignedInt(226, 6);  // OR NOT
  // TODO(schwehr): add in the offset of the dest mmsi

  assert(bs.GetRemaining() == 0); <== This crashes
schwehr commented 8 years ago

I could really use a donation of several messages, not just one to help make better tests.

mb12 commented 8 years ago

@schwehr Thank you very much for the response. I am using the following data set for testing.

http://www.aishub.net/nmea-sample.php