We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1285ec commit 3a1565cCopy full SHA for 3a1565c
color_info.cpp
@@ -1,10 +1,13 @@
1
#include "color_info.hpp"
2
#include <lcms2.h>
3
4
+// Maximum ICC profile size we're willing to parse (1MB)
5
+static const size_t MAX_ICC_PROFILE_SIZE = 1024 * 1024;
6
+
7
// Check if ICC profile indicates HDR (PQ or HLG transfer function)
8
bool is_hdr_transfer_function(const uint8_t* icc_data, size_t icc_len)
9
{
- if (!icc_data || icc_len == 0) {
10
+ if (!icc_data || icc_len == 0 || icc_len > MAX_ICC_PROFILE_SIZE) {
11
return false;
12
}
13
0 commit comments