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

Coverity issue(s) #15

Open
jackun opened this issue Oct 6, 2020 · 2 comments
Open

Coverity issue(s) #15

jackun opened this issue Oct 6, 2020 · 2 comments

Comments

@jackun
Copy link

jackun commented Oct 6, 2020

  1. Statement is always false:

if ((index & 0x10) > 0x10)

And just in case this is not a false positive:
2) Overrunning array jpgd::g_ZAG of 64 4-byte elements at element index 64 (byte offset 259) using index kt++ (which evaluates to 64).

p[g_ZAG[kt++]] = 0;

@richgel999
Copy link
Owner

Thank you, I'll add a logical and against 63 here to silence Coverity. I've seen the 2nd issue before, this statement should prevent the problem but I'll add the logical and in the loop to be sure:

if ((k + r) > 63)
stop_decoding(JPGD_DECODE_ERROR);

@jackun
Copy link
Author

jackun commented Oct 6, 2020

Then I think the 2nd issue has been fixed already

jpeg-compressor/jpgd.cpp

Lines 1525 to 1526 in aeb7d3b

if ((k + r) > 63)
stop_decoding(JPGD_DECODE_ERROR);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants