[Bf-blender-cvs] [c5db0272d4b] master: Fix T70276: View animation with jpeg 2000 image will crash player

Philipp Oeser noreply at git.blender.org
Fri Sep 27 12:05:26 CEST 2019


Commit: c5db0272d4befa4ee8c7da8dec8932e379a7275f
Author: Philipp Oeser
Date:   Fri Sep 27 11:09:38 2019 +0200
Branches: master
https://developer.blender.org/rBc5db0272d4befa4ee8c7da8dec8932e379a7275f

Fix T70276: View animation with jpeg 2000 image will crash player

Since our ffmpeg is built with openjpeg support and thus can decode jpeg
2000 (in both J2K and JP2 codec flavors as well as high bitdepths), added
these extensions to the supported list.

Also IMB_ispic > IMB_ispic_type > imb_is_a_jp2 was only testing for jp2,
now do both jp2/j2k.

Reviewers: brecht

Maniphest Tasks: T70276

Differential Revision: https://developer.blender.org/D5909

===================================================================

M	source/blender/imbuf/intern/jp2.c
M	source/blender/imbuf/intern/util.c

===================================================================

diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 3bf97cb851f..e361df1304a 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -83,7 +83,7 @@ static OPJ_CODEC_FORMAT format_from_header(const unsigned char mem[JP2_FILEHEADE
 
 int imb_is_a_jp2(const unsigned char *buf)
 {
-  return check_jp2(buf);
+  return (check_jp2(buf) || check_j2k(buf));
 }
 
 /**
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index c5bae4ddbad..27b566e25a2 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -252,6 +252,8 @@ static int isffmpeg(const char *filename)
   if (BLI_path_extension_check_n(filename,
                                  ".swf",
                                  ".jpg",
+                                 ".jp2",
+                                 ".j2c",
                                  ".png",
                                  ".dds",
                                  ".tga",



More information about the Bf-blender-cvs mailing list