obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
60.66k stars 8.02k forks source link

[BUG] 'readlink' fails without reporting an error code #2622

Closed yurivict closed 4 years ago

yurivict commented 4 years ago

This call failed on FreeBSD: https://github.com/obsproject/obs-studio/blob/master/libobs/util/platform-nix.c#L278 and obs-studio just accepted "-1" as "count", and just returned "NULL" to https://github.com/obsproject/obs-studio/blob/master/plugins/obs-ffmpeg/obs-ffmpeg-mux.c#L235 where NULL was just processed in a bogus way.

Please, always immediately check return codes of all system calls for errors, report the errors to the user using strerror(errno), and terminate the application after the error message.

The original bug report from the user: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245299

WizardCM commented 4 years ago

Please fill in the issue template.

Fenrirthviti commented 4 years ago

Please do not delete our issue template. It should be properly filled out.

yurivict commented 4 years ago

Platform

Operating system and version: FreeBSD 12

OBS Studio version: 25.0.1

Expected Behavior

Failed to save the video to disk

Current Behavior

Save the video to disk.

Steps to Reproduce

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245299#c0

yurivict commented 4 years ago

There are 2 problems:

  1. It continues despite the error message. Once this error has occurred, the application should be terminated.
  2. The linux part doesn't check for the error.