Skip to content

Commit

Permalink
Only fail on memory allocation after initializing other variables (#747)
Browse files Browse the repository at this point in the history
As this issue was not reproducible, this might not actually be a
fix.

Credit: Oss-Fuzz
Issue: https://issues.oss-fuzz.com/issues/42538252
  • Loading branch information
ktmf01 authored Oct 4, 2024
1 parent a89875d commit 40ca8c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/flac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,16 +658,16 @@ FLAC__bool init_options(void)

option_values.num_files = 0;
option_values.filenames = 0;

if(0 == (option_values.vorbis_comment = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT)))
return false;
option_values.num_pictures = 0;

option_values.debug.disable_constant_subframes = false;
option_values.debug.disable_fixed_subframes = false;
option_values.debug.disable_verbatim_subframes = false;
option_values.debug.do_md5 = true;

if(0 == (option_values.vorbis_comment = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT)))
return false;

return true;
}

Expand Down

0 comments on commit 40ca8c7

Please sign in to comment.