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

JPEG images with width of 1 cause crash #46434

Closed
ghost opened this issue Feb 26, 2021 · 4 comments
Closed

JPEG images with width of 1 cause crash #46434

ghost opened this issue Feb 26, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 26, 2021

Godot version:

3.2.4-rc3 (crashes 3.2.3 as well)

OS/device including version:

Windows 10

Issue description:

Godot attempts to import the image and then crashes.

Steps to reproduce:

  1. Add jpeg image with width of 1 to project
  2. Crash

Minimal reproduction project:

test.zip
Here is a test image:
crash

@qarmin
Copy link
Contributor

qarmin commented Feb 26, 2021

Message in terminal

godots: thirdparty/jpeg-compressor/jpgd.h:278: int jpgd::jpeg_decoder::check_sample_buf_ofs(int) const: Assertion `ofs >= 0' failed.

@Riteo
Copy link
Contributor

Riteo commented Feb 26, 2021

This looks exactly like #42363. I guess it was supposed to be fixed, but from the looks of it this isn't the case.

@akien-mga akien-mga added this to the 4.0 milestone Feb 26, 2021
@AndyBarcia
Copy link
Contributor

AndyBarcia commented Feb 26, 2021

This looks exactly like #42363. I guess it was supposed to be fixed, but from the looks of it this isn't the case.

Sorry if I'm being mistaken. But I think that it does solve the problem. But the pull request wasn't cherrypicked to 3.2.4

In the jpgd.cpp file you can see that in master the line is:

const int half_image_x_size = (m_image_x_size == 1) ? 0 : (m_image_x_size >> 1) - 1;

while in 3.2 the line is:

const int half_image_x_size = (m_image_x_size >> 1) - 1;

I think this needs to be merged

@akien-mga
Copy link
Member

Indeed, seems like I missed my cherry-pick of #43441 last time. Now fixed.
So closing as duplicate of #42363.

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

No branches or pull requests

5 participants