Skip to content

Commit

Permalink
Change order of checks.
Browse files Browse the repository at this point in the history
Basically that is no-op, unless function is called from auto-generated fuzzer.
(those does stupid thing: for 0-sized vector it takes .data(); changing order
of checks we avoid touching that invalid pointer)
  • Loading branch information
eustas committed Dec 11, 2023
1 parent 216f00e commit e6ed9e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libfaad/decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ void* NeAACDecDecode2(NeAACDecHandle hpDecoder,
unsigned long sample_buffer_size)
{
NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
if ((sample_buffer == NULL) || (*sample_buffer == NULL) || (sample_buffer_size == 0))
if ((sample_buffer_size == 0) || (sample_buffer == NULL) || (*sample_buffer == NULL))
{
hInfo->error = 27;
return NULL;
Expand Down

0 comments on commit e6ed9e9

Please sign in to comment.