Skip to content

Commit

Permalink
Merge pull request #10 from Asd-g/main-2
Browse files Browse the repository at this point in the history
Fix undefined behavior
  • Loading branch information
erazortt authored Feb 25, 2023
2 parents 0c5e32d + bdb69b8 commit 08e94c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DoViBaker/DoViProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ bool DoViProcessor::intializeFrame(int frame, IScriptEnvironment* env) {
if (header->guessed_profile != 7) {
dovi_rpu_free_data_mapping(mapping_data);
dovi_rpu_free_header(header);
is_fel = false;
return successfulCreation;
}

Expand Down Expand Up @@ -303,7 +304,7 @@ uint16_t DoViProcessor::processSample(int cmp, uint16_t bl, uint16_t el, uint16_
}

int DoViProcessor::getPivotIndex(int cmp, uint16_t s) const {
int pivot_idx = num_pivots_minus1[cmp];
int pivot_idx = num_pivots_minus1[cmp] - 1;
for (int idx = 0; idx < num_pivots_minus1[cmp]; idx++) {
if (s < pivot_value[cmp][idx + 1]) {
pivot_idx = idx;
Expand Down

0 comments on commit 08e94c9

Please sign in to comment.