Skip to content

Commit

Permalink
export: crash if nullptr passed
Browse files Browse the repository at this point in the history
The export module is now intended to be initialized always, although
not exporting at that moment, so assert the state presence for
export_audio/export_video.
  • Loading branch information
MartinPulec committed Aug 9, 2024
1 parent d371815 commit 4143900
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <assert.h>
#include <dirent.h>
#include <errno.h> // for errno, EEXIST
#include <limits.h>
Expand Down Expand Up @@ -340,9 +341,7 @@ static void process_messages(struct exporter *s) {

void export_audio(struct exporter *s, struct audio_frame *frame)
{
if(!s){
return;
}
assert(s != NULL);

process_messages(s);

Expand All @@ -355,9 +354,7 @@ void export_audio(struct exporter *s, struct audio_frame *frame)

void export_video(struct exporter *s, struct video_frame *frame)
{
if(!s){
return;
}
assert(s != NULL);

process_messages(s);

Expand Down

0 comments on commit 4143900

Please sign in to comment.