Page 1 of 1

Crash in vout_display_PlacePicture

Posted: 06 Jan 2023 17:21
by Hanley
I've implemented libvlc in my Mac app and am encountering a very annoying bug that only affects some of my users some of the time, and I can't recreate it on my end. Basically, when they load a video and hit play, the app crashes.

The only breadcrumb I have to go on is that their crash reports all point to the same line in libvlccore as the cause: vout_display_PlacePicture + 288

But even this is limited as it's an isolated line in the crash report with no preceding lines in the stack trace. With this admittedly small amount of knowledge, do you have any theories or suggestions as to what I could be doing wrong that might cause a crash at this line only some of the time?

Re: Crash in vout_display_PlacePicture

Posted: 06 Jan 2023 19:27
by wbtcpip
which version of libvlc?

Re: Crash in vout_display_PlacePicture

Posted: 06 Jan 2023 19:55
by Hanley
3.0.17

Re: Crash in vout_display_PlacePicture

Posted: 08 Jan 2023 09:27
by RĂ©mi Denis-Courmont
I'm not sure what you expect here with basically no info provided. As you could easily gather from looking at the source code, there are two ways that that function can crash: invalid pointers supplied, or division by zero due to invalid SAR.

Re: Crash in vout_display_PlacePicture

Posted: 09 Jan 2023 19:02
by Hanley
Yeah, sorry, I was being a bit lazy wasn't I. It's a floating point exception so yes, probably division by zero. Looking at the function it appears there could be a few culprits making the 0. The only one I'm not sure of is source->i_sar_den. The documentation on that variable offers no description. What does that variable represent?

Re: Crash in vout_display_PlacePicture

Posted: 09 Jan 2023 19:04
by Hanley
Actually, a better question for clarification: If it's an invalid SAR, does that simply mean I'm supplying it with a 0 aspect ratio?

Re: Crash in vout_display_PlacePicture

Posted: 09 Jan 2023 20:07
by Hanley
Also, is it possible your previous commit might prevent such a crash: https://github.com/videolan/vlc/commit/ ... 09426fc87e