Continuous Memory Occupying
UESuperGate opened this issue · 0 comments
UESuperGate commented
Expected behavior and actual behavior.
When trying to decompress a .jp2
file to a .pgm
file, opj_decompress
will parse each code block. However, if a malformatted file with an extremely large amount of code blocks is received by openjpeg
, it will keep parsing the blocks and finally exhaust all the memory of the OS.
Steps to reproduce the problem.
It's better to set timeout in case that server gets down because of the exhaustion of memory space.
timeout 60s ./opj_decompress -i ./poc1 -o /tmp/img.pgm
At the same time, use htop
to checkout memory occupied status.
Operating system
Ubuntu 20.04 with kernel 5.4.0.
openjpeg version
commit: a589155
openjp2 library v2.5.0