noobdoesre / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

FILE* in opj API is unsafe #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Due to large file support implementation,
it is unsafe to have FILE* in openjpeg.h

The library is now compiled with LFS when it is available (it will be hard to 
find a system without this support).
This involves activating some flags in the hidden opj_config.h, which modify 
the behaviour of system header.

From the application point of view, if the application code is not compiled 
with LFS, then fopen returns a FILE* which is incompatible with the internal 
fseek/ftell used inside openjpeg library.

Forcing application code to be compiled with LFS is probably not an option.
Too risky...

3 public functions are incriminated :
opj_stream_create_default_file_stream (FILE * p_file, opj_bool p_is_read_stream)
opj_stream_create_file_stream (FILE * p_file, OPJ_UINT32 p_buffer_size, 
opj_bool p_is_read_stream)
opj_dump_codec( opj_codec_t *p_codec,OPJ_INT32 info_flag,FILE* output_stream)

They should take "const char*" and do the fopen/fclose internally.

Original issue reported on code.google.com by julien.m...@gmail.com on 16 Feb 2012 at 11:02

GoogleCodeExporter commented 9 years ago

Original comment by antonin on 20 Feb 2012 at 4:04

GoogleCodeExporter commented 9 years ago

Original comment by antonin on 20 Feb 2012 at 4:18

GoogleCodeExporter commented 9 years ago
See also #198

Original comment by julien.m...@gmail.com on 30 Nov 2012 at 11:46

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 24 Feb 2014 at 9:04

GoogleCodeExporter commented 9 years ago
closing issue 120, please follow issue 198 instead. thanks

Original comment by mathieu.malaterre on 25 Feb 2014 at 3:28

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 27 Feb 2014 at 5:11