Make sure to check the correct flac init return values.
Check for valid return values when calling FLAC__stream_encoder_init_stream() and FLAC__stream_decoder_init_stream().
Handle non-OK return values as an error, instead of looking for return values that can not be returned from these methods. Note, the integer value for both FLAC__STREAM_DECODER_SEARCH_FOR_METADATA, FLAC__STREAM_ENCODER_OK, FLAC__STREAM_DECODER_INIT_STATUS_OK and FLAC__STREAM_ENCODER_INIT_STATUS_OK are all zero, so the behaviour of the code do not change.
This avoid the following compiler message:
flac.c: In function ‘fs_flac_decode_header’:
flac.c:269:10: warning: comparison between ‘FLAC__StreamDecoderInitStatus’ and ‘enum <anonymous>’ [-Wenum-compare]
269 | ) != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
| ^~
flac.c: In function ‘fs_flac_enc_headers’:
flac.c:610:10: warning: comparison between ‘FLAC__StreamEncoderInitStatus’ and ‘enum <anonymous>’ [-Wenum-compare]
610 | ) != FLAC__STREAM_ENCODER_OK)
| ^~
Merge request reports
Activity
requested review from @rillian
added 9 commits
-
7e7aa383...5115cc7a - 8 commits from branch
master
- 6cee91b9 - Make sure to check the correct flac init return values.
-
7e7aa383...5115cc7a - 8 commits from branch
mentioned in merge request !2 (merged)
added 3 commits
-
6cee91b9...a60090c4 - 2 commits from branch
master
- 94aa8804 - Make sure to check the correct flac init return values.
-
6cee91b9...a60090c4 - 2 commits from branch
Just for the record, the CI run for this patch will not turn green until !4 (merged) is applied.
mentioned in merge request !4 (merged)
added 1 commit
- 4b2c0e84 - Make sure to check the correct flac init return values.
added 3 commits
-
4b2c0e84...181f9956 - 2 commits from branch
master
- 5c2b7f3b - Make sure to check the correct flac init return values.
-
4b2c0e84...181f9956 - 2 commits from branch
mentioned in commit f92bc4c4