Skip to content

exit program when bmp file is oversize #48

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

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

Marsman1996
Copy link
Contributor

@Marsman1996 Marsman1996 commented Dec 16, 2021

fix issue #47

When bmp's size is out of range, it returns without assign memory buffer to pb->pdata and did not exit the program.
So the program crashes when it tries to access the pb->data in jfif.c:763, which is a invalid memory address.

ffjpeg/src/jfif.c

Lines 757 to 763 in d5cfd49

bsrc = pb->pdata;
ydst = yuv_datbuf[0];
udst = yuv_datbuf[1];
vdst = yuv_datbuf[2];
for (i=0; i<pb->height; i++) {
for (j=0; j<pb->width; j++) {
rgb_to_yuv(bsrc[2], bsrc[1], bsrc[0], ydst, udst, vdst);

@Marsman1996
Copy link
Contributor Author

log added

Copy link
Owner

@rockcarry rockcarry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved

@rockcarry rockcarry merged commit caade60 into rockcarry:master Dec 16, 2021
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

Successfully merging this pull request may close these issues.

2 participants