VireoSDK icon indicating copy to clipboard operation
VireoSDK copied to clipboard

-Infinity values are not handled correctly in JSON

Open rajsite opened this issue 2 years ago • 2 comments

A user found that when using UnflattenFromJSON for double arrays, if the JSON string encounters -Infinity then:

  1. The node errors with code -375011
  2. The node returns an array with partially parsed results

See forum: https://forums.ni.com/t5/G-Web-Development-Software/Bug-on-Unflatten-from-JSON/m-p/4361814#M702

image

Didn't thoroughly debug but scanning source the following line looks suspicious which seems to indicate that any negative value will not be treated like Infinity:

https://github.com/ni/VireoSDK/blob/673eb0dea01418f6ca20e6a2a53528a941eef7ca/source/core/TDCodecVia.cpp#L1207-L1207

rajsite avatar Mar 20 '24 19:03 rajsite

Agreed, it looks like that line will cause a -Inf to be treated as if it was an overflow a few lines below and return an error.

spathiwa avatar Mar 20 '24 19:03 spathiwa

Created two AzDo bugs for the issue:

  1. Lack of support for -Infinity
  2. Returning partial / incorrect results on error (effectively user data corruption on error)

rajsite avatar Mar 28 '24 23:03 rajsite