Skip to content

fix: read 64-bit mpv INT64 properties without truncating to 32 bits#776

Open
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/int64-property-truncation
Open

fix: read 64-bit mpv INT64 properties without truncating to 32 bits#776
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/int64-property-truncation

Conversation

@Noethix55555

Copy link
Copy Markdown

Two places read an MPV_FORMAT_INT64 property as 32 bits:

  • GetPropertyInt: returns lpBuffer.ToInt32(), silently truncating values above 2 GB. GetPropertyLong on the same pointer correctly uses ToInt64(). Fix: return (int)lpBuffer.ToInt64().

  • OnPropertyChange INT64 branch: uses Marshal.PtrToStructure(data.data), reading only 4 of the 8 bytes mpv wrote. Fix: use Marshal.PtrToStructure(data.data) and narrow to int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant