Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert tail-recursion to loop to avoid stack exhaustion #2543

Merged
merged 1 commit into from
Mar 12, 2023

Conversation

kevinbackhouse
Copy link
Collaborator

This fixes an OSS-Fuzz issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56746

This call to decodeBlocks is a tail-recursion, so it can be converted to a loop:

exiv2/src/riffvideo.cpp

Lines 466 to 468 in 1697417

if (!io_->eof() && io_->tell() < io_->size()) {
decodeBlocks();
}

@ghost
Copy link

ghost commented Mar 11, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@codecov
Copy link

codecov bot commented Mar 11, 2023

Codecov Report

Merging #2543 (5136c3c) into main (1697417) will decrease coverage by 0.63%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main    #2543      +/-   ##
==========================================
- Coverage   64.59%   63.97%   -0.63%     
==========================================
  Files         103      103              
  Lines       22224    22468     +244     
  Branches    10857    10856       -1     
==========================================
+ Hits        14356    14374      +18     
- Misses       5633     5873     +240     
+ Partials     2235     2221      -14     
Impacted Files Coverage Δ
src/riffvideo.cpp 62.43% <80.00%> (-2.72%) ⬇️

... and 57 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kevinbackhouse kevinbackhouse added bug OSS-Fuzz Bug reported by https://google.github.io/oss-fuzz/ labels Mar 11, 2023
@neheb neheb merged commit 244799f into Exiv2:main Mar 12, 2023
@kevinbackhouse kevinbackhouse deleted the fix-riff-stackexhaustion branch March 12, 2023 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug OSS-Fuzz Bug reported by https://google.github.io/oss-fuzz/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants