Commit: 9e0a2db32563cd568cf22b18bfcf5ba81248ebde Author: Campbell Barton Date: Thu Jan 18 15:20:27 2018 +1100 Branches: temp-openjpeg23 https://developer.blender.org/rB9e0a2db32563cd568cf22b18bfcf5ba81248ebde
Remove OPJ_DISABLE_TPSOT_FIX workaround Own seek function was incorrect (was using SEEK_CUR instead of SEEK_SET) =================================================================== M extern/libopenjpeg/CMakeLists.txt M extern/libopenjpeg/README.blender M source/blender/imbuf/intern/jp2.c =================================================================== diff --git a/extern/libopenjpeg/CMakeLists.txt b/extern/libopenjpeg/CMakeLists.txt index 13a822ba37f..7b2a690520c 100644 --- a/extern/libopenjpeg/CMakeLists.txt +++ b/extern/libopenjpeg/CMakeLists.txt @@ -34,7 +34,6 @@ set(INC_SYS add_definitions( -DUSE_JPIP # see: https://github.com/uclouvain/openjpeg/issues/254 - -DOPJ_DISABLE_TPSOT_FIX ${OPENJPEG_DEFINES} ) diff --git a/extern/libopenjpeg/README.blender b/extern/libopenjpeg/README.blender index 7a04c4df400..4d83054fbd9 100644 --- a/extern/libopenjpeg/README.blender +++ b/extern/libopenjpeg/README.blender @@ -2,10 +2,4 @@ Project: OpenJPEG URL: http://www.openjpeg.org License: BSD 2-Clause Upstream version: 2.3 -Local modifications: - -Notes: -- A complication, it doesn't load files saved from Blender - unless a define is set: "OPJ_DISABLE_TPSOT_FIX". - See: https://github.com/uclouvain/openjpeg/issues/254 - So we can't use 'WITH_SYSTEM_OPENJPEG'. +Local modifications: \ No newline at end of file diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index fba0b0e3305..8fc94fee1fb 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -191,8 +191,8 @@ static OPJ_OFF_T opj_skip_from_buffer(OPJ_OFF_T p_nb_bytes, void *p_user_data) static OPJ_BOOL opj_seek_from_buffer(OPJ_OFF_T p_nb_bytes, void *p_user_data) { struct BufInfo *p_file = p_user_data; - if (p_file->cur + p_nb_bytes < p_file->buf + p_file->len) { - p_file->cur += p_nb_bytes; + if (p_nb_bytes < p_file->len) { + p_file->cur = p_file->buf + p_nb_bytes; return OPJ_TRUE; } p_file->cur = p_file->buf + p_file->len; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs