Skip to content

Error in ReportDescriptor.cs ParseEncodedItem(EncodedItem item) for Linux. #2

@SSL-Julian

Description

@SSL-Julian

Hi,
I'm trying to use HidSharp to process touch screen input on Linux and had trouble parsing the ReportDescriptor. The error was
"System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
in ParseEncodedItem.

This is the current global item push/pop code

case GlobalItemTag.Push:
    State.GlobalItemStateStack.Add(new Dictionary<GlobalItemTag, EncodedItem>(State.GlobalItemState));
    break;

case GlobalItemTag.Pop:
    State.GlobalItemStateStack.RemoveAt(State.GlobalItemState.Count - 1);
    break;

I think the Pop function needs to use GlobalItemStateStack instead of GlobalItemState when determining the index.

case GlobalItemTag.Pop:
    State.GlobalItemStateStack.RemoveAt(State.GlobalItemStateStack.Count - 1);
    break;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions