Package: chromium-browser / 70.0.3538.110-1~deb9u1

system/openjpeg21.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
description: maintain compatibility with openjpeg 2.1
author: chromium 57 authors

--- a/third_party/pdfium/core/fxcodec/codec/ccodec_jpxmodule.cpp
+++ b/third_party/pdfium/core/fxcodec/codec/ccodec_jpxmodule.cpp
@@ -41,20 +41,20 @@ opj_stream_t* fx_opj_stream_create_memor
 }
 
 bool alloc_rgb(int** out_r, int** out_g, int** out_b, size_t size) {
-  int* r = static_cast<int*>(opj_image_data_alloc(size));
+  int* r = FX_Alloc(int, size);
   if (!r)
     return false;
 
-  int* g = static_cast<int*>(opj_image_data_alloc(size));
+  int* g = FX_Alloc(int, size);
   if (!g) {
-    opj_image_data_free(r);
+    FX_Free(r);
     return false;
   }
 
-  int* b = static_cast<int*>(opj_image_data_alloc(size));
+  int* b = FX_Alloc(int, size);
   if (!b) {
-    opj_image_data_free(r);
-    opj_image_data_free(g);
+    FX_Free(r);
+    FX_Free(g);
     return false;
   }
 
@@ -115,9 +115,9 @@ void sycc444_to_rgb(opj_image_t* img) {
   for (size_t i = 0; i < max_size.ValueOrDie(); ++i) {
     sycc_to_rgb(offset, upb, *y++, *cb++, *cr++, r++, g++, b++);
   }
-  opj_image_data_free(img->comps[0].data);
-  opj_image_data_free(img->comps[1].data);
-  opj_image_data_free(img->comps[2].data);
+  FX_Free(img->comps[0].data);
+  FX_Free(img->comps[1].data);
+  FX_Free(img->comps[2].data);
   img->comps[0].data = d0;
   img->comps[1].data = d1;
   img->comps[2].data = d2;
@@ -183,9 +183,9 @@ void sycc422_to_rgb(opj_image_t* img) {
       sycc_to_rgb(offset, upb, *y++, *cb++, *cr++, r++, g++, b++);
     }
   }
-  opj_image_data_free(img->comps[0].data);
-  opj_image_data_free(img->comps[1].data);
-  opj_image_data_free(img->comps[2].data);
+  FX_Free(img->comps[0].data);
+  FX_Free(img->comps[1].data);
+  FX_Free(img->comps[2].data);
   img->comps[0].data = d0;
   img->comps[1].data = d1;
   img->comps[2].data = d2;
@@ -439,9 +439,9 @@ void sycc420_to_rgb(opj_image_t* img) {
     }
   }
 
-  opj_image_data_free(img->comps[0].data);
-  opj_image_data_free(img->comps[1].data);
-  opj_image_data_free(img->comps[2].data);
+  FX_Free(img->comps[0].data);
+  FX_Free(img->comps[1].data);
+  FX_Free(img->comps[2].data);
   img->comps[0].data = d0;
   img->comps[1].data = d1;
   img->comps[2].data = d2;
--- a/third_party/pdfium/core/fxcodec/codec/cjpx_decoder.h
+++ b/third_party/pdfium/core/fxcodec/codec/cjpx_decoder.h
@@ -13,7 +13,7 @@
 #include "core/fxcodec/codec/codec_int.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "third_party/base/span.h"
-#include <openjpeg-2.3/openjpeg.h>
+#include <openjpeg-2.1/openjpeg.h>
 
 class CPDF_ColorSpace;
 
--- a/third_party/pdfium/core/fxcodec/codec/codec_int.h
+++ b/third_party/pdfium/core/fxcodec/codec/codec_int.h
@@ -15,7 +15,7 @@
 #include <vector>
 
 #include "core/fxcodec/jbig2/JBig2_Context.h"
-#include <openjpeg-2.3/openjpeg.h>
+#include <openjpeg-2.1/openjpeg.h>
 
 class CPDF_ColorSpace;