Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mParticle Crash when duration is provided as 0 #8

Open
gpe08 opened this issue Jun 7, 2023 · 2 comments
Open

mParticle Crash when duration is provided as 0 #8

gpe08 opened this issue Jun 7, 2023 · 2 comments

Comments

@gpe08
Copy link

gpe08 commented Jun 7, 2023

While working on the mParticle implementation on Sky, we found out a crash can happen if we start the MPMediaSession object with a duration of 0. This is due to the code on line: https://github.com/mParticle/mparticle-apple-media-sdk/blob/master/mParticle-Apple-Media-SDK/MPMediaSDK.swift#L367

This code handles a nil duration, but if it's 0, it will cause a math inconsistency (dividing by 0), which causes a crash on the app.

We would like this handling to be improved, and it might be a good idea to check the duration is not negative too, as it could cause some weird reporting.

For the time being, we will be making sure not to send 0 or negatives, but this is something that should be handled within the media SDK

@einsteinx2
Copy link
Contributor

Thanks for the report. I'll get an internal bug ticket created for this. Looks like a pretty clear issue.

@einsteinx2
Copy link
Contributor

I forgot to post that this is bring tracked internally as https://go.mparticle.com/work/SQDSDKS-5457

There are currently some other things ahead of this, but wanted to let you know this wasn't forgotten. I'll update this issue when a new release is out with the input sanitization improved.

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

No branches or pull requests

2 participants