NRK deleted branch double-free from NRK/legacy-imlib2 2024-01-02 21:55:13 -08:00
NRK closed pull request old/legacy-imlib2#21 2024-01-02 21:55:01 -08:00
PNG: fix double-free and setjmp UB
NRK commented on pull request old/legacy-imlib2#21 2024-01-02 21:55:00 -08:00
PNG: fix double-free and setjmp UB

i.e. malloc before setjmp.

Oops, I didn't even notice that the malloc size doesn't depend on the png library and could've been just moved before the setjmp. But yeah, I fully agree with the…

NRK pushed to double-free at NRK/legacy-imlib2 2024-01-02 03:02:21 -08:00
fb6a74b55e PNG saver: avoid UB on misc.data
30107247b6 Change formatting style
Compare 2 commits »
NRK commented on pull request old/legacy-imlib2#21 2024-01-02 02:55:48 -08:00
PNG: fix double-free and setjmp UB

In the first example just adding volatile like this works too:

Yup, that works too. But the reason I didn't do that and instead made a copy is because the saver has code like this:

NRK pushed to double-free at NRK/legacy-imlib2 2024-01-02 02:55:25 -08:00
c928e7ebee PNG saver: avoid UB on misc.data
cd8c225ed0 Y4M loader: don't fail on newline
2d210b9af3 Y4M loader: Fix warning in non-debug build
820c5b2ebe PNG loader: Properly suppress messages from libpng
3e8c01bef6 PNG saver: avoid double-free on write errors
9ad4769e0a ANI loader: Avoid debug line when image does not have proper signature
06314730ff Y4M loader: Avoid use of sscanf() in frame rate parsing
4109f54c4a test_load_2: Check some more y4m files
Compare 8 commits »
NRK commented on pull request old/legacy-imlib2#21 2024-01-01 23:32:52 -08:00
PNG: fix double-free and setjmp UB

Notice that the setjmp branch doesn't free the actually allocated pointer but instead free-s NULL that was assigned at the time of calling setjmp.

Also here's a version that keeps a…

NRK commented on pull request old/legacy-imlib2#21 2024-01-01 23:26:12 -08:00
PNG: fix double-free and setjmp UB

Unless of course if you can actually demonstrate that there is a problem.

Okay, I did some small testing and it looks like this doesn't reliably work even on GCC. Here's a small test case:…

NRK commented on pull request old/legacy-imlib2#21 2024-01-01 21:07:17 -08:00
PNG: fix double-free and setjmp UB

I think that the proper solution should be applied at all four locations.

Wasn't aware of jpeg doing longjmp as well. I'll look into that too.

(Sidenote: why is it so hard for libraries to…

NRK commented on pull request old/legacy-imlib2#21 2023-12-31 01:49:30 -08:00
PNG: fix double-free and setjmp UB

@kw Noticed two other issues:

$ ./scrot -o /dev/full
libpng error: Write Error
scrot: failed to save image: /dev/full: No saver for file format
  1. libpng is doing stderr…
NRK created pull request old/legacy-imlib2#21 2023-12-31 01:46:10 -08:00
PNG: fix double-free and setjmp UB
NRK created branch double-free in NRK/legacy-imlib2 2023-12-31 01:42:30 -08:00
NRK pushed to double-free at NRK/legacy-imlib2 2023-12-31 01:42:30 -08:00
45deaf9580 PNG saver: avoid UB on misc.data
7ebe11b981 PNG saver: avoid double-free on write errors
6ff2ac0815 Consistently use #if IMLIB2_DEBUG (not #ifdef)
1bdc69a6a1 Y4M loader: Guard some debug code properly
96e04dd8cf Y4M loader: add error messages on parsing errors
c08ae5fdfb Y4M loader: fix C option analysis
a780b47892 Y4M loader: fix support for unexpected framerates
3106fbd0d2 x11_grab: Remove some obsolete code
45d58cc268 test_save: Update crcs for jxl saver (libjxl 0.8.0)
9198db2536 v1.12.1
Compare 10 commits »
NRK opened issue old/legacy-imlib2#16 2023-07-02 07:45:19 -07:00
add imlib_decache_file() or similar
NRK commented on pull request old/legacy-imlib2#14 2023-06-22 07:52:00 -07:00
Y4M loader: use custom y4m parser

@kw Also just noticed, the tests should now allow y4m memory as well. Attached a patch.

NRK deleted branch y4m from NRK/legacy-imlib2 2023-06-22 07:50:05 -07:00
NRK closed pull request old/legacy-imlib2#14 2023-06-21 10:56:14 -07:00
Y4M loader: use custom y4m parser
NRK commented on pull request old/legacy-imlib2#14 2023-06-21 08:43:46 -07:00
Y4M loader: use custom y4m parser

Squashed the commits and hopefully the compiler warning should be fixed now too.

NRK pushed to y4m at NRK/legacy-imlib2 2023-06-21 08:40:30 -07:00
2cea59b3da Y4M loader: use custom y4m parser
bb53bcfb9d loading: check for alloc failure
3dfef024c9 loading: add some debug logs
36c1daef60 TGA loader: Fix TGA v2.0 signature check
Compare 4 commits »
NRK commented on pull request old/legacy-imlib2#14 2023-06-20 13:52:24 -07:00
Y4M loader: use custom y4m parser

What version of GCC is that? I don't get that warning (gcc 12.1.1) and that's clearly false positive since the only case those variable aren't initialized is if the color space was mono. (But if…

NRK commented on pull request old/legacy-imlib2#14 2023-06-20 12:44:21 -07:00
Y4M loader: use custom y4m parser

Is it ready for merging?

Yeah, everything works fine as far as I tested. Wanted to remove dependency on libyuv as well, but that'll have to wait for some other day :)

Can I squash the…

NRK deleted branch dlerror from NRK/legacy-imlib2 2023-06-20 07:18:52 -07:00
NRK pushed to y4m at NRK/legacy-imlib2 2023-06-20 02:06:30 -07:00
2a314057c4 Y4M loader: use memcmp()
NRK pushed to y4m at NRK/legacy-imlib2 2023-06-20 01:42:38 -07:00
85d3bdc22b Y4M loader: use custom y4m parser
NRK commented on pull request old/legacy-imlib2#14 2023-06-19 15:26:22 -07:00
Y4M loader: use custom y4m parser

Oops, forgot to fix this up. I'll look into what this is tomorrow :)

NRK commented on pull request old/legacy-imlib2#14 2023-06-19 15:26:22 -07:00
Y4M loader: use custom y4m parser
NRK created pull request old/legacy-imlib2#15 2023-06-19 13:58:00 -07:00
Add some logging and allocation failure check
NRK created branch dlerror in NRK/legacy-imlib2 2023-06-19 13:57:21 -07:00
NRK pushed to dlerror at NRK/legacy-imlib2 2023-06-19 13:57:21 -07:00
0f4f3722b5 loading: check for alloc failure
b8a05b5f0b loading: add some debug logs
Compare 2 commits »
NRK created pull request old/legacy-imlib2#14 2023-06-19 13:56:55 -07:00
Y4M loader: use custom y4m parser
NRK pushed to y4m at NRK/legacy-imlib2 2023-06-19 13:53:51 -07:00
31bba57db8 Y4M loader: use custom y4m parser
NRK created branch y4m in NRK/legacy-imlib2 2023-06-19 13:52:41 -07:00
NRK pushed to y4m at NRK/legacy-imlib2 2023-06-19 13:52:41 -07:00
9f3c65a5d9 Y4M loader: use custom y4m parser
0f4f3722b5 loading: check for alloc failure
b8a05b5f0b loading: add some debug logs
Compare 3 commits »
NRK created repository NRK/legacy-imlib2 2023-06-19 13:46:25 -07:00
NRK commented on issue old/legacy-imlib2#13 2023-06-18 01:32:23 -07:00
Quality issues with liby4m

And it would be nice to not rely on a library that AFAIK is not generally available in distros.

Going by repology, it's not packaged in a single distro. libyuv [seems decently pacakged](https:…

NRK commented on issue old/legacy-imlib2#13 2023-06-17 03:20:32 -07:00
Quality issues with liby4m

The y4m format doesn't seem too complicated. I might give it a go since I'm fairly free the next ~2weeks or so :)

NRK opened issue old/legacy-imlib2#13 2023-06-17 01:57:44 -07:00
Quality issues with liby4m
NRK opened issue old/legacy-imlib2#11 2023-05-22 12:47:49 -07:00
Don't check for freetype2 if text was disabled
NRK closed issue old/legacy-imlib2#7 2023-02-16 00:39:37 -08:00
Feature request: Add "save to fd" function
NRK commented on issue old/legacy-imlib2#7 2023-02-16 00:37:53 -08:00
Feature request: Add "save to fd" function

This looks about right. So closing the issue.

Also - closing the fd seems dubious to me as well. But better to be consistent, I think. The caller just needs to dup the fd before passing it to…

NRK commented on issue old/legacy-imlib2#7 2023-02-14 11:30:53 -08:00
Feature request: Add "save to fd" function

A filename parameter would make imlib_save_image_fd useless, we're back to TOCTTOU baked into the API.

I don't think so. The "filename" in load_fd is only used as an extension guess. The…

NRK commented on issue old/legacy-imlib2#7 2023-02-14 08:28:37 -08:00
Feature request: Add "save to fd" function

Either FILE * or fd should work fine for scrot's purposes.

NRK opened issue old/legacy-imlib2#7 2023-02-14 05:13:48 -08:00
Feature request: Add "save to FILE *" function
NRK commented on issue old/legacy-imlib2#5 2023-02-10 01:35:04 -08:00
imlib2 doesn't handle EINTR

Could just set SA_RESTART to avoid all the pain.

That's something that should be done on the application side. Altering global state behind the user's back is NOT something I like to see in…

NRK commented on issue old/legacy-imlib2#5 2023-02-03 12:36:53 -08:00
imlib2 doesn't handle EINTR

I don't think poking into the current implementation details of one kernel and writing programs according to those details and a particular set of use cases is the right way to do things.…

NRK commented on issue old/legacy-imlib2#4 2023-01-31 03:32:11 -08:00
Feature Request: ICC Color Management (redirected)

From what I understand, transforming the image before it's loaded should be ok.

What do you mean by "before it's loaded" - I'm not sure how an image can be transformed without loading…

NRK commented on issue old/legacy-imlib2#4 2023-01-30 11:30:18 -08:00
Feature Request: ICC Color Management (redirected)

I may now reveal my abysmal lack of knowledge about color spaces, gamut, ICC profiles, etc.

Same here for what it's worth :-)

Modifying loaders to deal with ICC profiles just to modify…

NRK commented on issue old/legacy-imlib2#4 2023-01-30 07:42:57 -08:00
Feature Request: ICC Color Management (redirected)

I think the original issue should've been pasted here, rather than just a link (some people read these issues via email notification and it's not convineient to open a webbrowser just to follow a…

NRK closed issue old/legacy-imlib2#1 2022-09-29 12:45:47 -07:00
imlib_load_image_mem(): crashes on mmap-ed files