libopusenc-0.3-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
libopusenc-0.3/examples/opusenc_example.c:20:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libopusenc-0.3/examples/opusenc_example.c:11:6: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libopusenc-0.3/examples/opusenc_example.c:15:9: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:15:9: acquire_resource: opened here
libopusenc-0.3/examples/opusenc_example.c:16:6: branch_false: following ‘false’ branch...
libopusenc-0.3/examples/opusenc_example.c:20:14: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:20:14: throw: if ‘ope_comments_create’ throws an exception...
libopusenc-0.3/examples/opusenc_example.c:20:14: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   18|       return 1;
#   19|     }
#   20|->   comments = ope_comments_create();
#   21|     ope_comments_add(comments, "ARTIST", "Someone");
#   22|     ope_comments_add(comments, "TITLE", "Some track");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libopusenc-0.3/examples/opusenc_example.c:20:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libopusenc-0.3/examples/opusenc_example.c:11:6: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libopusenc-0.3/examples/opusenc_example.c:15:9: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:15:9: acquire_memory: allocated here
libopusenc-0.3/examples/opusenc_example.c:16:6: branch_false: following ‘false’ branch...
libopusenc-0.3/examples/opusenc_example.c:20:14: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:20:14: throw: if ‘ope_comments_create’ throws an exception...
libopusenc-0.3/examples/opusenc_example.c:20:14: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   18|       return 1;
#   19|     }
#   20|->   comments = ope_comments_create();
#   21|     ope_comments_add(comments, "ARTIST", "Someone");
#   22|     ope_comments_add(comments, "TITLE", "Some track");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
libopusenc-0.3/examples/opusenc_example.c:21:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libopusenc-0.3/examples/opusenc_example.c:11:6: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libopusenc-0.3/examples/opusenc_example.c:15:9: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:15:9: acquire_resource: opened here
libopusenc-0.3/examples/opusenc_example.c:16:6: branch_false: following ‘false’ branch...
libopusenc-0.3/examples/opusenc_example.c:20:14: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:21:3: throw: if ‘ope_comments_add’ throws an exception...
libopusenc-0.3/examples/opusenc_example.c:21:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   19|     }
#   20|     comments = ope_comments_create();
#   21|->   ope_comments_add(comments, "ARTIST", "Someone");
#   22|     ope_comments_add(comments, "TITLE", "Some track");
#   23|     enc = ope_encoder_create_file(argv[2], comments, 44100, 2, 0, &error);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
libopusenc-0.3/examples/opusenc_example.c:21:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libopusenc-0.3/examples/opusenc_example.c:11:6: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libopusenc-0.3/examples/opusenc_example.c:15:9: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:15:9: acquire_memory: allocated here
libopusenc-0.3/examples/opusenc_example.c:16:6: branch_false: following ‘false’ branch...
libopusenc-0.3/examples/opusenc_example.c:20:14: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:21:3: throw: if ‘ope_comments_add’ throws an exception...
libopusenc-0.3/examples/opusenc_example.c:21:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#   19|     }
#   20|     comments = ope_comments_create();
#   21|->   ope_comments_add(comments, "ARTIST", "Someone");
#   22|     ope_comments_add(comments, "TITLE", "Some track");
#   23|     enc = ope_encoder_create_file(argv[2], comments, 44100, 2, 0, &error);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
libopusenc-0.3/examples/opusenc_example.c:22:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libopusenc-0.3/examples/opusenc_example.c:11:6: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libopusenc-0.3/examples/opusenc_example.c:15:9: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:15:9: acquire_resource: opened here
libopusenc-0.3/examples/opusenc_example.c:16:6: branch_false: following ‘false’ branch...
libopusenc-0.3/examples/opusenc_example.c:20:14: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:22:3: throw: if ‘ope_comments_add’ throws an exception...
libopusenc-0.3/examples/opusenc_example.c:22:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#   20|     comments = ope_comments_create();
#   21|     ope_comments_add(comments, "ARTIST", "Someone");
#   22|->   ope_comments_add(comments, "TITLE", "Some track");
#   23|     enc = ope_encoder_create_file(argv[2], comments, 44100, 2, 0, &error);
#   24|     if (!enc) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libopusenc-0.3/examples/opusenc_example.c:22:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libopusenc-0.3/examples/opusenc_example.c:11:6: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libopusenc-0.3/examples/opusenc_example.c:15:9: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:15:9: acquire_memory: allocated here
libopusenc-0.3/examples/opusenc_example.c:16:6: branch_false: following ‘false’ branch...
libopusenc-0.3/examples/opusenc_example.c:20:14: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:22:3: throw: if ‘ope_comments_add’ throws an exception...
libopusenc-0.3/examples/opusenc_example.c:22:3: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#   20|     comments = ope_comments_create();
#   21|     ope_comments_add(comments, "ARTIST", "Someone");
#   22|->   ope_comments_add(comments, "TITLE", "Some track");
#   23|     enc = ope_encoder_create_file(argv[2], comments, 44100, 2, 0, &error);
#   24|     if (!enc) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
libopusenc-0.3/examples/opusenc_example.c:23:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’
libopusenc-0.3/examples/opusenc_example.c:11:6: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libopusenc-0.3/examples/opusenc_example.c:15:9: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:15:9: acquire_resource: opened here
libopusenc-0.3/examples/opusenc_example.c:16:6: branch_false: following ‘false’ branch...
libopusenc-0.3/examples/opusenc_example.c:20:14: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:23:9: throw: if ‘ope_encoder_create_file’ throws an exception...
libopusenc-0.3/examples/opusenc_example.c:23:9: danger: ‘fopen(argv[1], "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#   21|     ope_comments_add(comments, "ARTIST", "Someone");
#   22|     ope_comments_add(comments, "TITLE", "Some track");
#   23|->   enc = ope_encoder_create_file(argv[2], comments, 44100, 2, 0, &error);
#   24|     if (!enc) {
#   25|       fprintf(stderr, "error encoding to file %s: %s\n", argv[2], ope_strerror(error));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
libopusenc-0.3/examples/opusenc_example.c:23:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’
libopusenc-0.3/examples/opusenc_example.c:11:6: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libopusenc-0.3/examples/opusenc_example.c:15:9: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:15:9: acquire_memory: allocated here
libopusenc-0.3/examples/opusenc_example.c:16:6: branch_false: following ‘false’ branch...
libopusenc-0.3/examples/opusenc_example.c:20:14: branch_false: ...to here
libopusenc-0.3/examples/opusenc_example.c:23:9: throw: if ‘ope_encoder_create_file’ throws an exception...
libopusenc-0.3/examples/opusenc_example.c:23:9: danger: ‘fopen(argv[1], "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#   21|     ope_comments_add(comments, "ARTIST", "Someone");
#   22|     ope_comments_add(comments, "TITLE", "Some track");
#   23|->   enc = ope_encoder_create_file(argv[2], comments, 44100, 2, 0, &error);
#   24|     if (!enc) {
#   25|       fprintf(stderr, "error encoding to file %s: %s\n", argv[2], ope_strerror(error));

Error: GCC_ANALYZER_WARNING (CWE-465): [#def9]
libopusenc-0.3/src/opus_header.c:280:6: warning[-Wanalyzer-deref-before-check]: check of 'p' for NULL after already dereferencing it
#  278|   
#  279|     p=(char*)realloc(p, len);
#  280|->   if (p == NULL) return 1;
#  281|   
#  282|     writeint(p, *length, tag_len+val_len);      /* length of comment */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
libopusenc-0.3/src/opusenc.c:282:10: warning[-Wanalyzer-malloc-leak]: leak of 'packet_copy'
libopusenc-0.3/src/opusenc.c:762:5: enter_function: entry to 'ope_encoder_write'
libopusenc-0.3/src/opusenc.c:764:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:765:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:766:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:767:6: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:767:6: branch_false: following 'false' branch (when 'samples_per_channel >= 0')...
libopusenc-0.3/src/opusenc.c:768:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:783:8: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:785:20: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:786:16: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:789:77: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:801:5: call_function: calling 'encode_buffer' from 'ope_encoder_write'
#  280|     unsigned char *page;
#  281|     int len;
#  282|->   while (oggp_get_next_page(enc->oggp, &page, &len)) {
#  283|       int ret = enc->callbacks.write(enc->streams->user_data, page, len);
#  284|       if (ret) return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
libopusenc-0.3/src/opusenc.c:283:15: warning[-Wanalyzer-malloc-leak]: leak of 'packet_copy'
libopusenc-0.3/src/opusenc.c:762:5: enter_function: entry to 'ope_encoder_write'
libopusenc-0.3/src/opusenc.c:764:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:765:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:766:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:767:6: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:767:6: branch_false: following 'false' branch (when 'samples_per_channel >= 0')...
libopusenc-0.3/src/opusenc.c:768:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:783:8: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:785:20: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:786:16: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:789:77: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:801:5: call_function: calling 'encode_buffer' from 'ope_encoder_write'
#  281|     int len;
#  282|     while (oggp_get_next_page(enc->oggp, &page, &len)) {
#  283|->     int ret = enc->callbacks.write(enc->streams->user_data, page, len);
#  284|       if (ret) return ret;
#  285|     }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
libopusenc-0.3/src/opusenc.c:289:3: warning[-Wanalyzer-malloc-leak]: leak of 'packet_copy'
libopusenc-0.3/src/opusenc.c:762:5: enter_function: entry to 'ope_encoder_write'
libopusenc-0.3/src/opusenc.c:764:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:765:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:766:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:767:6: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:767:6: branch_false: following 'false' branch (when 'samples_per_channel >= 0')...
libopusenc-0.3/src/opusenc.c:768:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:783:8: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:785:20: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:786:16: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:789:77: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:801:5: call_function: calling 'encode_buffer' from 'ope_encoder_write'
#  287|   }
#  288|   static int oe_flush_page(OggOpusEnc *enc) {
#  289|->   oggp_flush_page(enc->oggp);
#  290|     if (!enc->pull_api) return output_pages(enc);
#  291|     return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
libopusenc-0.3/src/opusenc.c:650:7: warning[-Wanalyzer-malloc-leak]: leak of 'packet_copy'
libopusenc-0.3/src/opusenc.c:762:5: enter_function: entry to 'ope_encoder_write'
libopusenc-0.3/src/opusenc.c:764:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:765:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:766:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:767:6: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:767:6: branch_false: following 'false' branch (when 'samples_per_channel >= 0')...
libopusenc-0.3/src/opusenc.c:768:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:783:8: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:785:20: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:786:16: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:789:77: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:801:5: call_function: calling 'encode_buffer' from 'ope_encoder_write'
#  648|           memcpy(packet_copy, packet, nbBytes);
#  649|         }
#  650|->       oggp_commit_packet(enc->oggp, nbBytes, granulepos, e_o_s);
#  651|         if (e_o_s) ret = oe_flush_page(enc);
#  652|         else if (!enc->pull_api) ret = output_pages(enc);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
libopusenc-0.3/src/opusenc.c:663:17: warning[-Wanalyzer-malloc-leak]: leak of 'packet_copy'
libopusenc-0.3/src/opusenc.c:762:5: enter_function: entry to 'ope_encoder_write'
libopusenc-0.3/src/opusenc.c:764:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:765:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:766:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:767:6: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:767:6: branch_false: following 'false' branch (when 'samples_per_channel >= 0')...
libopusenc-0.3/src/opusenc.c:768:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:783:8: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:785:20: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:786:16: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:789:77: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:801:5: call_function: calling 'encode_buffer' from 'ope_encoder_write'
#  661|           tmp = enc->streams->next;
#  662|           if (enc->streams->close_at_end && !enc->pull_api) {
#  663|->           ret = enc->callbacks.close(enc->streams->user_data);
#  664|             if (ret) {
#  665|               enc->unrecoverable = OPE_CLOSE_FAIL;

Error: CPPCHECK_WARNING (CWE-457): [#def15]
libopusenc-0.3/src/opusenc.c:789: warning[uninitvar]: Uninitialized variable: buf
#  787|           buf[i] = (1.f/32768)*pcm[i];
#  788|         }
#  789|->       speex_resampler_process_interleaved_float(enc->re, buf, &in_samples, &enc->buffer[channels*enc->buffer_end], &out_samples);
#  790|       } else {
#  791|         int curr;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libopusenc-0.3/src/opusenc.c:887:15: warning[-Wanalyzer-malloc-leak]: leak of 'obj'
libopusenc-0.3/src/opusenc.c:886:15: acquire_memory: allocated here
libopusenc-0.3/src/opusenc.c:886:6: branch_false: following 'false' branch (when 'obj' is non-NULL)...
libopusenc-0.3/src/opusenc.c:887:15: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:887:15: throw: if 'opeint_fopen' throws an exception...
libopusenc-0.3/src/opusenc.c:887:15: danger: 'obj' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  885|     struct StdioObject *obj;
#  886|     if (!(obj = malloc(sizeof(*obj)))) return OPE_ALLOC_FAIL;
#  887|->   obj->file = opeint_fopen(path, "wb");
#  888|     if (!obj->file) {
#  889|       free(obj);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def17]
libopusenc-0.3/src/opusenc.c:951:13: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libopusenc-0.3/src/opusenc.c:928:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:929:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:929:3: acquire_resource: 'va_start' called here
libopusenc-0.3/src/opusenc.c:951:13: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:951:13: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:951:13: throw: if 'opus_projection_encoder_ctl' throws an exception...
libopusenc-0.3/src/opusenc.c:951:13: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  949|       {
#  950|         opus_int32 value = va_arg(ap, opus_int32);
#  951|->       ret = opeint_encoder_ctl2(&enc->st, request, value);
#  952|       }
#  953|       break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def18]
libopusenc-0.3/src/opusenc.c:957:13: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libopusenc-0.3/src/opusenc.c:928:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:929:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:929:3: acquire_resource: 'va_start' called here
libopusenc-0.3/src/opusenc.c:957:13: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:957:13: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:957:13: throw: if 'opus_projection_encoder_ctl' throws an exception...
libopusenc-0.3/src/opusenc.c:957:13: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  955|       {
#  956|         opus_int32 *value = va_arg(ap, opus_int32*);
#  957|->       ret = opeint_encoder_ctl(&enc->st, OPUS_GET_LOOKAHEAD(value));
#  958|       }
#  959|       break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def19]
libopusenc-0.3/src/opusenc.c:971:13: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libopusenc-0.3/src/opusenc.c:928:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:929:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:929:3: acquire_resource: 'va_start' called here
libopusenc-0.3/src/opusenc.c:967:10: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:971:13: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:971:13: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:971:13: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:971:13: throw: if 'opus_projection_encoder_ctl' throws an exception...
libopusenc-0.3/src/opusenc.c:971:13: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  969|           break;
#  970|         }
#  971|->       ret = opeint_encoder_ctl(&enc->st, OPUS_SET_EXPERT_FRAME_DURATION(value));
#  972|         if (ret == OPUS_OK) {
#  973|           enc->frame_size = compute_frame_samples(value);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def20]
libopusenc-0.3/src/opusenc.c:997:13: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libopusenc-0.3/src/opusenc.c:928:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:929:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:929:3: acquire_resource: 'va_start' called here
libopusenc-0.3/src/opusenc.c:997:13: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:997:13: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:997:13: throw: if 'opus_projection_encoder_ctl' throws an exception...
libopusenc-0.3/src/opusenc.c:997:13: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  995|       {
#  996|         opus_int32 *value = va_arg(ap, opus_int32*);
#  997|->       ret = opeint_encoder_ctl2(&enc->st, request, value);
#  998|       }
#  999|       break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def21]
libopusenc-0.3/src/opusenc.c:1006:7: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libopusenc-0.3/src/opusenc.c:928:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:929:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:929:3: acquire_resource: 'va_start' called here
libopusenc-0.3/src/opusenc.c:1006:7: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:1006:7: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:1006:7: throw: if 'opus_projection_encoder_ctl' throws an exception...
libopusenc-0.3/src/opusenc.c:1006:7: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
# 1004|         stream_id = va_arg(ap, opus_int32);
# 1005|         value = va_arg(ap, OpusEncoder**);
# 1006|->       opeint_encoder_ctl(&enc->st, OPUS_MULTISTREAM_GET_ENCODER_STATE(stream_id, value));
# 1007|       }
# 1008|       break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def22]
libopusenc-0.3/src/opusenc.c:1036:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libopusenc-0.3/src/opusenc.c:928:6: branch_false: following 'false' branch...
libopusenc-0.3/src/opusenc.c:929:3: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:929:3: acquire_resource: 'va_start' called here
libopusenc-0.3/src/opusenc.c:1031:10: branch_false: following 'false' branch (when 'value >= 0')...
libopusenc-0.3/src/opusenc.c:1035:7: branch_false: ...to here
libopusenc-0.3/src/opusenc.c:1036:10: branch_true: following 'true' branch...
libopusenc-0.3/src/opusenc.c:1036:22: branch_true: ...to here
libopusenc-0.3/src/opusenc.c:1036:22: throw: if 'oggp_set_muxing_delay' throws an exception...
libopusenc-0.3/src/opusenc.c:1036:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 1034|         }
# 1035|         enc->max_ogg_delay = value;
# 1036|->       if (enc->oggp) oggp_set_muxing_delay(enc->oggp, enc->max_ogg_delay);
# 1037|       }
# 1038|       break;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
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-149.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-x86_64
project-namelibopusenc-0.3-1.fc44
store-results-to/tmp/tmp_2zblgoh/libopusenc-0.3-1.fc44.tar.xz
time-created2026-01-08 19:10:06
time-finished2026-01-08 19:11:34
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp_2zblgoh/libopusenc-0.3-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp_2zblgoh/libopusenc-0.3-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9