Altough ffdmx handle most of j2k files well using j2kdec filter, same decoding with rfimg -- instead of ffdmx -- causes a crash on line 564 of   dec_j2k.c (opj_image_destroy(image);).

You will find enclosed an example of a j2k file format where the given command line : 
./gpac -i  Bretagne1.j2k -o test.png

provokes a Segmentation fault (core dumped)

The filters connected are:
rfimg (src=Bretagne1.j2k) (idx=1)
-(PID video1) j2kdec (dyn_idx=3)
--(PID video1) pngenc "encpng:1.6.39" (dyn_idx=4)
---(PID video1) writegen (dyn_idx=5)
----(PID video1) fout (dst=test.png) (idx=2)


[Bretagne1.zip](https://github.com/gpac/gpac/files/12360566/Bretagne1.zip)

rfimg filter fails at decoding most of j2k files format
This is a GitHub Issue
repo:gpac
owner:gpac
Title : rfimg filter fails at decoding most of j2k files format
Issue date:

--- start body ---
Altough ffdmx handle most of j2k files well using j2kdec filter, same decoding with rfimg -- instead of ffdmx -- causes a crash on line 564 of   dec_j2k.c (opj_image_destroy(image);).

You will find enclosed an example of a j2k file format where the given command line : 
./gpac -i  Bretagne1.j2k -o test.png

provokes a Segmentation fault (core dumped)

The filters connected are:
rfimg (src=Bretagne1.j2k) (idx=1)
-(PID video1) j2kdec (dyn_idx=3)
--(PID video1) pngenc "encpng:1.6.39" (dyn_idx=4)
---(PID video1) writegen (dyn_idx=5)
----(PID video1) fout (dst=test.png) (idx=2)


[Bretagne1.zip](https://github.com/gpac/gpac/files/12360566/Bretagne1.zip)

--- end body ---
