jpegxl-0.11.1-6.fc44

List of Findings

Error: CPPCHECK_WARNING (CWE-909): [#def1]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:230: error[uninitStructMember]: Uninitialized struct member: root.left_child
#  228|     root.start = 0;
#  229|     root.num = intervals.size();
#  230|->   patch_tree_.push_back(root);
#  231|     size_t next = 0;
#  232|     while (next < patch_tree_.size()) {

Error: CPPCHECK_WARNING (CWE-909): [#def2]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:230: error[uninitStructMember]: Uninitialized struct member: root.right_child
#  228|     root.start = 0;
#  229|     root.num = intervals.size();
#  230|->   patch_tree_.push_back(root);
#  231|     size_t next = 0;
#  232|     while (next < patch_tree_.size()) {

Error: CPPCHECK_WARNING (CWE-909): [#def3]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:230: error[uninitStructMember]: Uninitialized struct member: root.y_center
#  228|     root.start = 0;
#  229|     root.num = intervals.size();
#  230|->   patch_tree_.push_back(root);
#  231|     size_t next = 0;
#  232|     while (next < patch_tree_.size()) {

Error: CPPCHECK_WARNING (CWE-457): [#def4]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:230: error[uninitvar]: Uninitialized variables: root.left_child, root.right_child, root.y_center
#  228|     root.start = 0;
#  229|     root.num = intervals.size();
#  230|->   patch_tree_.push_back(root);
#  231|     size_t next = 0;
#  232|     while (next < patch_tree_.size()) {

Error: CPPCHECK_WARNING (CWE-909): [#def5]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:271: error[uninitStructMember]: Uninitialized struct member: left.left_child
#  269|         left.num = left_end - left.start;
#  270|         patch_tree_[next].left_child = patch_tree_.size();
#  271|->       patch_tree_.push_back(left);
#  272|       }
#  273|       if (right_start < end) {

Error: CPPCHECK_WARNING (CWE-909): [#def6]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:271: error[uninitStructMember]: Uninitialized struct member: left.right_child
#  269|         left.num = left_end - left.start;
#  270|         patch_tree_[next].left_child = patch_tree_.size();
#  271|->       patch_tree_.push_back(left);
#  272|       }
#  273|       if (right_start < end) {

Error: CPPCHECK_WARNING (CWE-909): [#def7]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:271: error[uninitStructMember]: Uninitialized struct member: left.y_center
#  269|         left.num = left_end - left.start;
#  270|         patch_tree_[next].left_child = patch_tree_.size();
#  271|->       patch_tree_.push_back(left);
#  272|       }
#  273|       if (right_start < end) {

Error: CPPCHECK_WARNING (CWE-457): [#def8]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:271: error[uninitvar]: Uninitialized variables: left.left_child, left.right_child, left.y_center
#  269|         left.num = left_end - left.start;
#  270|         patch_tree_[next].left_child = patch_tree_.size();
#  271|->       patch_tree_.push_back(left);
#  272|       }
#  273|       if (right_start < end) {

Error: CPPCHECK_WARNING (CWE-909): [#def9]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:278: error[uninitStructMember]: Uninitialized struct member: right.left_child
#  276|         right.num = end - right.start;
#  277|         patch_tree_[next].right_child = patch_tree_.size();
#  278|->       patch_tree_.push_back(right);
#  279|       }
#  280|       ++next;

Error: CPPCHECK_WARNING (CWE-909): [#def10]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:278: error[uninitStructMember]: Uninitialized struct member: right.right_child
#  276|         right.num = end - right.start;
#  277|         patch_tree_[next].right_child = patch_tree_.size();
#  278|->       patch_tree_.push_back(right);
#  279|       }
#  280|       ++next;

Error: CPPCHECK_WARNING (CWE-909): [#def11]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:278: error[uninitStructMember]: Uninitialized struct member: right.y_center
#  276|         right.num = end - right.start;
#  277|         patch_tree_[next].right_child = patch_tree_.size();
#  278|->       patch_tree_.push_back(right);
#  279|       }
#  280|       ++next;

Error: CPPCHECK_WARNING (CWE-457): [#def12]
libjxl-0.11.1/lib/jxl/dec_patch_dictionary.cc:278: error[uninitvar]: Uninitialized variables: right.left_child, right.right_child, right.y_center
#  276|         right.num = end - right.start;
#  277|         patch_tree_[next].right_child = patch_tree_.size();
#  278|->       patch_tree_.push_back(right);
#  279|       }
#  280|       ++next;

Error: CPPCHECK_WARNING (CWE-457): [#def13]
libjxl-0.11.1/lib/jxl/enc_fast_lossless.cc:550: warning[uninitvar]: Uninitialized variable: compact_freqs
#  548|       }
#  549|       uint8_t num_bits[kMaxNumSymbols] = {};
#  550|->     ComputeCodeLengthsNonZero(compact_freqs, ni, min_limit, max_limit,
#  551|                                 num_bits);
#  552|       ni = 0;

Error: COMPILER_WARNING (CWE-457): [#def14]
libjxl-0.11.1/lib/jxl/enc_fast_lossless.cc: scope_hint: In function ‘(anonymous namespace)::PrefixCode::ComputeCodeLengths(unsigned long const*, unsigned long, unsigned char const*, unsigned char const*, unsigned char*)’
libjxl-0.11.1/lib/jxl/enc_fast_lossless.cc:550:30: warning[-Wmaybe-uninitialized]: ‘compact_freqs’ may be used uninitialized
#  550 |     ComputeCodeLengthsNonZero(compact_freqs, ni, min_limit, max_limit,
#      |     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  551 |                               num_bits);
#      |                               ~~~~~~~~~
libjxl-0.11.1/lib/jxl/enc_fast_lossless.cc:503:15: note: by argument 1 of type ‘const uint64_t *’ to ‘(anonymous namespace)::PrefixCode::ComputeCodeLengthsNonZero(unsigned long const*, unsigned long, unsigned char*, unsigned char*, unsigned char*)’ declared here
#  503 |   static void ComputeCodeLengthsNonZero(const uint64_t* freqs, size_t n,
#      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
libjxl-0.11.1/lib/jxl/enc_fast_lossless.cc:537:14: note: ‘compact_freqs’ declared here
#  537 |     uint64_t compact_freqs[kMaxNumSymbols];
#      |              ^~~~~~~~~~~~~
#  548|       }
#  549|       uint8_t num_bits[kMaxNumSymbols] = {};
#  550|->     ComputeCodeLengthsNonZero(compact_freqs, ni, min_limit, max_limit,
#  551|                                 num_bits);
#  552|       ni = 0;

Error: CPPCHECK_WARNING (CWE-398): [#def15]
libjxl-0.11.1/lib/jxl/enc_icc_codec.cc:172: error[containerOutOfBounds]: Out of bounds access in 'kTagStrings[j]', if 'kTagStrings' size is 4 and 'j' is 16
#  170|         uint8_t tagcode = kCommandTagUnknown;
#  171|         for (size_t j = 0; j < kNumTagStrings; j++) {
#  172|->         if (tag == *kTagStrings[j]) {
#  173|             tagcode = j + kCommandTagStringFirst;
#  174|             break;

Error: CPPCHECK_WARNING (CWE-398): [#def16]
libjxl-0.11.1/lib/jxl/enc_icc_codec.cc:409: error[containerOutOfBounds]: Out of bounds access in 'kTypeStrings[i]', if 'kTypeStrings' size is 4 and 'i' is 7
#  407|           Tag subTag = DecodeKeyword(icc, size, pos);
#  408|           for (size_t i = 0; i < kNumTypeStrings; i++) {
#  409|->           if (subTag == *kTypeStrings[i]) {
#  410|               JXL_RETURN_IF_ERROR(
#  411|                   commands_add.push_back(kCommandTypeStartFirst + i));

Error: CPPCHECK_WARNING (CWE-562): [#def17]
libjxl-0.11.1/lib/jxl/encode.cc:187: error[danglingLifetime]: Non-local variable 'next_out_' will use pointer to local variable 'next_out'.
#  185|     JXL_ENSURE(!external_output_processor_);
#  186|     avail_out_ = avail_out;
#  187|->   next_out_ = next_out;
#  188|     JXL_RETURN_IF_ERROR(FlushOutput());
#  189|     return true;

Error: COMPILER_WARNING: [#def18]
libjxl-0.11.1/lib/jxl/encode.cc:187:13: warning[-Wdangling-pointer=]: storing the address of local variable ‘next_out’ in ‘this_12(D)->next_out_’
#  187 |   next_out_ = next_out;
#      |   ~~~~~~~~~~^~~~~~~~~~
libjxl-0.11.1/lib/jxl/encode.cc: scope_hint: In member function ‘JxlEncoderOutputProcessorWrapper::CopyOutput(std::vector<unsigned char, std::allocator<unsigned char> >&, unsigned char*, unsigned long&)’
libjxl-0.11.1/lib/jxl/encode.cc:193:44: note: ‘next_out’ declared here
#  193 |     std::vector<uint8_t>& output, uint8_t* next_out, size_t& avail_out) {
#      |                                   ~~~~~~~~~^~~~~~~~
libjxl-0.11.1/lib/jxl/encode.cc:193:71: note: ‘this’ declared here
#  193 |     std::vector<uint8_t>& output, uint8_t* next_out, size_t& avail_out) {
#      |                                                                       ^
#  185|     JXL_ENSURE(!external_output_processor_);
#  186|     avail_out_ = avail_out;
#  187|->   next_out_ = next_out;
#  188|     JXL_RETURN_IF_ERROR(FlushOutput());
#  189|     return true;

Error: CPPCHECK_WARNING (CWE-476): [#def19]
libjxl-0.11.1/lib/jxl/modular/encoding/enc_debug_tree.cc:99: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   97|   void PrintTree(const Tree &tree, const std::string &path) {
#   98|     FILE *f = fopen((path + ".dot").c_str(), "w");
#   99|->   fprintf(f, "graph{\n");
#  100|     for (size_t cur = 0; cur < tree.size(); cur++) {
#  101|       if (tree[cur].property < 0) {

Error: CPPCHECK_WARNING (CWE-476): [#def20]
libjxl-0.11.1/lib/jxl/modular/encoding/enc_debug_tree.cc:112: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#  110|       }
#  111|     }
#  112|->   fprintf(f, "}\n");
#  113|     fclose(f);
#  114|   #if JXL_ENABLE_DOT

Error: CPPCHECK_WARNING (CWE-476): [#def21]
libjxl-0.11.1/lib/jxl/modular/encoding/enc_debug_tree.cc:113: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#  111|     }
#  112|     fprintf(f, "}\n");
#  113|->   fclose(f);
#  114|   #if JXL_ENABLE_DOT
#  115|     system(("dot " + path + ".dot -T svg -o " + path + ".svg").c_str());

Error: CPPCHECK_WARNING (CWE-758): [#def22]
libjxl-0.11.1/lib/jxl/render_pipeline/stage_upsampling.cc:105: error[missingReturn]: Found an exit path from function with non-void return type that has missing return statement
#  103|                       [x % 8 < 4 ? x % 4 : 3 - x % 4][y % 8 < 4 ? iy : 4 - iy]
#  104|                       [x % 8 < 4 ? ix : 4 - ix];
#  105|->     }
#  106|     }
#  107|   

Error: CPPCHECK_WARNING (CWE-562): [#def23]
libjxl-0.11.1/lib/jxl/test_utils.cc:95: error[returnDanglingLifetime]: Returning object that points to local variable 'str' that will be invalid when returning.
#   93|     printf("Test data %s is %d bytes long.\n", filename.c_str(),
#   94|            static_cast<int>(data.size()));
#   95|->   return data;
#   96|   }
#   97|   

Error: CPPCHECK_WARNING (CWE-457): [#def24]
libjxl-0.11.1/third_party/sjpeg/src/enc.cc:1341: warning[uninitvar]: Uninitialized variable: sorted_freq
# 1339|     // initial sort
# 1340|     // TODO(skal): replace by counting-sort?? (merged with previous loop?)
# 1341|->   qsort(sorted_freq, nb_syms, sizeof(sorted_freq[0]), cmp);
# 1342|   
# 1343|     // fake last symbol, with lowest frequency: will be assigned to the forbidden

Error: CPPCHECK_WARNING (CWE-786): [#def25]
libjxl-0.11.1/third_party/sjpeg/src/enc.cc:1432: error[negativeIndex]: Array 'start[32]' accessed at index -1, which is out of bounds.
# 1430|       }
# 1431|     }
# 1432|->   assert(start[max_bit_size - 1] == nb_syms - 1);
# 1433|   
# 1434|     // Fix codes with length greater than 16 bits. We move too long

Error: CPPCHECK_WARNING (CWE-823): [#def26]
libjxl-0.11.1/third_party/sjpeg/src/jpeg_tools.cc:243: error[arrayIndexOutOfBounds]: Array 'yuv[24]' accessed at index 127, which is out of bounds.
#  241|     uint16_t idx[64];
#  242|     for (int k = 0; k < 64; ++k) {
#  243|->     idx[k] = YUVToRiskIdx(yuv[k + 0 * 64], yuv[k + 1 * 64],  yuv[k + 2 * 64]);
#  244|     }
#  245|     const int kRGB3 = sjpeg::kRGBSize * sjpeg::kRGBSize * sjpeg::kRGBSize;

Error: CPPCHECK_WARNING (CWE-823): [#def27]
libjxl-0.11.1/third_party/sjpeg/src/jpeg_tools.cc:243: error[arrayIndexOutOfBounds]: Array 'yuv[24]' accessed at index 191, which is out of bounds.
#  241|     uint16_t idx[64];
#  242|     for (int k = 0; k < 64; ++k) {
#  243|->     idx[k] = YUVToRiskIdx(yuv[k + 0 * 64], yuv[k + 1 * 64],  yuv[k + 2 * 64]);
#  244|     }
#  245|     const int kRGB3 = sjpeg::kRGBSize * sjpeg::kRGBSize * sjpeg::kRGBSize;

Error: CPPCHECK_WARNING (CWE-823): [#def28]
libjxl-0.11.1/third_party/sjpeg/src/jpeg_tools.cc:243: error[arrayIndexOutOfBounds]: Array 'yuv[24]' accessed at index 63, which is out of bounds.
#  241|     uint16_t idx[64];
#  242|     for (int k = 0; k < 64; ++k) {
#  243|->     idx[k] = YUVToRiskIdx(yuv[k + 0 * 64], yuv[k + 1 * 64],  yuv[k + 2 * 64]);
#  244|     }
#  245|     const int kRGB3 = sjpeg::kRGBSize * sjpeg::kRGBSize * sjpeg::kRGBSize;

Error: CPPCHECK_WARNING (CWE-786): [#def29]
libjxl-0.11.1/third_party/sjpeg/src/jpeg_tools.cc:252: error[negativeIndex]: Array 'idx[64]' accessed at index -1, which is out of bounds.
#  250|         const int k = I + J * 8;
#  251|         const int idx0 = idx[k + 0];
#  252|->       const int idx1 = idx[k + (I < 7 ? 1 : -1)];
#  253|         const int idx2 = idx[k + (J < 7 ? 8 : -8)];
#  254|         int score = sjpeg::kSharpnessScore[idx0 + kRGB3 * idx1]

Error: CPPCHECK_WARNING (CWE-786): [#def30]
libjxl-0.11.1/third_party/sjpeg/src/jpeg_tools.cc:253: error[negativeIndex]: Array 'idx[64]' accessed at index -8, which is out of bounds.
#  251|         const int idx0 = idx[k + 0];
#  252|         const int idx1 = idx[k + (I < 7 ? 1 : -1)];
#  253|->       const int idx2 = idx[k + (J < 7 ? 8 : -8)];
#  254|         int score = sjpeg::kSharpnessScore[idx0 + kRGB3 * idx1]
#  255|                   + sjpeg::kSharpnessScore[idx0 + kRGB3 * idx2]

Error: COMPILER_WARNING (CWE-457): [#def31]
libjxl-0.11.1/third_party/skcms/src/Transform_inl.h:119:14: warning[-Wmaybe-uninitialized]: ‘d’ may be used uninitialized
#  119 |         d[i] = v[i];
#      |         ~~~~~^~~~
libjxl-0.11.1/third_party/skcms/src/Transform_inl.h: scope_hint: In function ‘baseline::exec_ops(skcms_private::Op const*, void const**, char const*, char*, int)’
libjxl-0.11.1/third_party/skcms/src/Transform_inl.h:117:7: note: ‘d’ was declared here
#  117 |     D d;
#      |       ^
#  117|       D d;
#  118|       for (int i = 0; i < N; i++) {
#  119|->         d[i] = v[i];
#  120|       }
#  121|       return d;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
libjxl-0.11.1/tools/jxlinfo.c:96:31: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#   94|       // input is set yet, this is ok since the input is set when handling this
#   95|       // event.
#   96|->     JxlDecoderStatus status = JxlDecoderProcessInput(dec);
#   97|   
#   98|       if (status == JXL_DEC_ERROR) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libjxl-0.11.1/tools/jxlinfo.c:104:26: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  102|         // The first time there is nothing to release and it returns 0, but that
#  103|         // is ok.
#  104|->       size_t remaining = JxlDecoderReleaseInput(dec);
#  105|         // move any remaining bytes to the front if necessary
#  106|         if (remaining != 0) {

Error: CPPCHECK_WARNING (CWE-401): [#def34]
libjxl-0.11.1/tools/jxlinfo.c:111: error[memleakOnRealloc]: Common realloc mistake: 'data' nulled but not freed upon failure
#  109|         // resize the buffer to append one more chunk of data
#  110|         // TODO(lode): avoid unnecessary reallocations
#  111|->       data = (uint8_t*)realloc(data, remaining + chunk_size);
#  112|         // append bytes read from the file behind the remaining bytes
#  113|         size_t read_size = fread(data + remaining, 1, chunk_size, file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
libjxl-0.11.1/tools/jxlinfo.c:119:7: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  117|         }
#  118|         data_size = remaining + read_size;
#  119|->       JxlDecoderSetInput(dec, data, data_size);
#  120|         if (feof(file)) JxlDecoderCloseInput(dec);
#  121|       } else if (status == JXL_DEC_SUCCESS) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
libjxl-0.11.1/tools/jxlinfo.c:120:10: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  118|         data_size = remaining + read_size;
#  119|         JxlDecoderSetInput(dec, data, data_size);
#  120|->       if (feof(file)) JxlDecoderCloseInput(dec);
#  121|       } else if (status == JXL_DEC_SUCCESS) {
#  122|         // Finished all processing.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
libjxl-0.11.1/tools/jxlinfo.c:120:23: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  118|         data_size = remaining + read_size;
#  119|         JxlDecoderSetInput(dec, data, data_size);
#  120|->       if (feof(file)) JxlDecoderCloseInput(dec);
#  121|       } else if (status == JXL_DEC_SUCCESS) {
#  122|         // Finished all processing.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
libjxl-0.11.1/tools/jxlinfo.c:125:30: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  123|         break;
#  124|       } else if (status == JXL_DEC_BASIC_INFO) {
#  125|->       if (JXL_DEC_SUCCESS != JxlDecoderGetBasicInfo(dec, &info)) {
#  126|           fprintf(stderr, "JxlDecoderGetBasicInfo failed\n");
#  127|           break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
libjxl-0.11.1/tools/jxlinfo.c:150:32: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  148|         for (uint32_t i = 0; i < info.num_extra_channels; i++) {
#  149|           JxlExtraChannelInfo extra;
#  150|->         if (JXL_DEC_SUCCESS != JxlDecoderGetExtraChannelInfo(dec, i, &extra)) {
#  151|             fprintf(stderr, "JxlDecoderGetExtraChannelInfo failed\n");
#  152|             break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
libjxl-0.11.1/tools/jxlinfo.c:270:11: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  268|         JxlColorEncoding color_encoding;
#  269|         if (JXL_DEC_SUCCESS ==
#  270|->           JxlDecoderGetColorAsEncodedProfile(
#  271|                 dec, JXL_COLOR_PROFILE_TARGET_ORIGINAL, &color_encoding)) {
#  272|           PrintColorEncoding(&color_encoding);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libjxl-0.11.1/tools/jxlinfo.c:290:32: warning[-Wanalyzer-malloc-leak]: leak of ‘profile’
libjxl-0.11.1/tools/jxlinfo.c:497:5: enter_function: entry to ‘main’
libjxl-0.11.1/tools/jxlinfo.c:505:6: branch_false: following ‘false’ branch (when ‘argc > 1’)...
 branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:511:19: branch_true: following ‘true’ branch (when ‘i < argc’)...
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: following ‘true’ branch (when ‘verbose == 0’)...
libjxl-0.11.1/tools/jxlinfo.c:512:33: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:21: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:512:21: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:515:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:511:29: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:522:10: branch_true: following ‘true’ branch (when ‘argc != 1’)...
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:523:47: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:47: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:47: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:526:17: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:526:17: call_function: calling ‘print_basic_info_filename’ from ‘main’
#  288|           }
#  289|           uint8_t* profile = (uint8_t*)malloc(profile_size);
#  290|->         if (JXL_DEC_SUCCESS != JxlDecoderGetColorAsICCProfile(
#  291|                                      dec, JXL_COLOR_PROFILE_TARGET_ORIGINAL,
#  292|                                      profile, profile_size)) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def42]
libjxl-0.11.1/tools/jxlinfo.c:323:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘info.have_animation’
libjxl-0.11.1/tools/jxlinfo.c:497:5: enter_function: entry to ‘main’
libjxl-0.11.1/tools/jxlinfo.c:505:6: branch_false: following ‘false’ branch (when ‘argc > 1’)...
 branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:511:19: branch_true: following ‘true’ branch (when ‘i < argc’)...
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: following ‘true’ branch (when ‘verbose == 0’)...
libjxl-0.11.1/tools/jxlinfo.c:512:33: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:21: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:512:21: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:515:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:511:29: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:522:10: branch_true: following ‘true’ branch (when ‘argc != 1’)...
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:523:47: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:47: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:47: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:526:17: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:526:17: call_function: calling ‘print_basic_info_filename’ from ‘main’
#  321|           printf("full image size");
#  322|         }
#  323|->       if (info.have_animation) {
#  324|           float ms = frame_header.duration * 1000.f *
#  325|                      info.animation.tps_denominator /

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
libjxl-0.11.1/tools/jxlinfo.c:380:9: warning[-Wanalyzer-malloc-leak]: leak of ‘box_data’
libjxl-0.11.1/tools/jxlinfo.c:497:5: enter_function: entry to ‘main’
libjxl-0.11.1/tools/jxlinfo.c:505:6: branch_false: following ‘false’ branch (when ‘argc > 1’)...
 branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:511:19: branch_true: following ‘true’ branch (when ‘i < argc’)...
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: following ‘true’ branch (when ‘verbose == 0’)...
libjxl-0.11.1/tools/jxlinfo.c:512:33: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:21: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:512:21: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:515:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:511:29: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:522:10: branch_true: following ‘true’ branch (when ‘argc != 1’)...
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:523:47: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:47: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:47: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:526:17: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:526:17: call_function: calling ‘print_basic_info_filename’ from ‘main’
#  378|           box_data = malloc(chunk_size);
#  379|           box_size = chunk_size;
#  380|->         JxlDecoderSetBoxBuffer(dec, box_data, box_size);
#  381|         } else {
#  382|           printf("unknown box: type: \"%.4s\" size: %" PRIu64 "\n", box_type,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
libjxl-0.11.1/tools/jxlinfo.c:399:7: warning[-Wanalyzer-malloc-leak]: leak of ‘temp’
libjxl-0.11.1/tools/jxlinfo.c:497:5: enter_function: entry to ‘main’
libjxl-0.11.1/tools/jxlinfo.c:505:6: branch_false: following ‘false’ branch (when ‘argc > 1’)...
 branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:511:19: branch_true: following ‘true’ branch (when ‘i < argc’)...
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: following ‘true’ branch (when ‘verbose == 0’)...
libjxl-0.11.1/tools/jxlinfo.c:512:33: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:21: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:512:21: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:515:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:511:29: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:522:10: branch_true: following ‘true’ branch (when ‘argc != 1’)...
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:523:47: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:47: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:47: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:526:17: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:526:17: call_function: calling ‘print_basic_info_filename’ from ‘main’
#  397|         }
#  398|         box_data = temp;
#  399|->       JxlDecoderSetBoxBuffer(dec, box_data + box_index, box_size - box_index);
#  400|       } else if (status == JXL_DEC_BOX_COMPLETE) {
#  401|         if (!strncmp(box_type, "jhgm", 4)) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def45]
libjxl-0.11.1/tools/jxlinfo.c:452:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘info.animation.num_loops’
libjxl-0.11.1/tools/jxlinfo.c:497:5: enter_function: entry to ‘main’
libjxl-0.11.1/tools/jxlinfo.c:505:6: branch_false: following ‘false’ branch (when ‘argc > 1’)...
 branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:511:19: branch_true: following ‘true’ branch (when ‘i < argc’)...
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:8: branch_true: following ‘true’ branch (when ‘verbose == 0’)...
libjxl-0.11.1/tools/jxlinfo.c:512:33: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:512:21: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:512:21: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:515:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:515:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:511:29: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:522:10: branch_true: following ‘true’ branch (when ‘argc != 1’)...
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_true: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:9: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:9: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:8: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:523:47: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:523:47: call_function: calling ‘is_flag’ from ‘main’
libjxl-0.11.1/tools/jxlinfo.c:523:47: return_function: returning to ‘main’ from ‘is_flag’
libjxl-0.11.1/tools/jxlinfo.c:523:9: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:526:17: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:526:17: call_function: calling ‘print_basic_info_filename’ from ‘main’
#  450|       }
#  451|     }
#  452|->   if (info.animation.num_loops > 1) total_duration *= info.animation.num_loops;
#  453|     if (info.have_animation) {
#  454|       printf("Animation length: %.3f seconds%s\n", total_duration * 0.001f,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
libjxl-0.11.1/tools/jxlinfo.c:480:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(jxl_filename, "rb")’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:473:16: acquire_resource: opened here
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  478|     int status = PrintBasicInfo(file, verbose);
#  479|     fclose(file);
#  480|->   if (!status) {
#  481|       fprintf(stderr, "Error reading file: %s\n", jxl_filename);
#  482|       return status;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
libjxl-0.11.1/tools/jxlinfo.c:480:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(jxl_filename, "rb")’
libjxl-0.11.1/tools/jxlinfo.c:472:12: enter_function: entry to ‘print_basic_info_filename’
libjxl-0.11.1/tools/jxlinfo.c:473:16: acquire_memory: allocated here
libjxl-0.11.1/tools/jxlinfo.c:474:6: branch_false: following ‘false’ branch...
libjxl-0.11.1/tools/jxlinfo.c:478:16: branch_false: ...to here
libjxl-0.11.1/tools/jxlinfo.c:478:16: call_function: calling ‘PrintBasicInfo’ from ‘print_basic_info_filename’
#  478|     int status = PrintBasicInfo(file, verbose);
#  479|     fclose(file);
#  480|->   if (!status) {
#  481|       fprintf(stderr, "Error reading file: %s\n", jxl_filename);
#  482|       return status;

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-142.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-gcc-latest-x86_64
project-namejpegxl-0.11.1-6.fc44
store-results-to/tmp/tmp_dps9vly/jpegxl-0.11.1-6.fc44.tar.xz
time-created2025-10-28 18:30:25
time-finished2025-10-28 18:45:14
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmp_dps9vly/jpegxl-0.11.1-6.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp_dps9vly/jpegxl-0.11.1-6.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9