The following issues were found
libavcodec/cavsdsp.c
2 issues
Line: 526
CWE codes:
682
CAVS_SUBPIX(put_ , op_put1, hpel, 0, -1, 5, 5, -1, 0)
CAVS_SUBPIX(put_ , op_put2, qpel_l, -1, -2, 96, 42, -7, 0)
CAVS_SUBPIX(put_ , op_put2, qpel_r, 0, -7, 42, 96, -2, -1)
CAVS_SUBPIX_HV(put_, op_put3, jj, 0, -1, 5, 5, -1, 0, 0, -1, 5, 5, -1, 0, 0)
CAVS_SUBPIX_HV(put_, op_put4, ff, 0, -1, 5, 5, -1, 0, -1, -2, 96, 42, -7, 0, 0)
CAVS_SUBPIX_HV(put_, op_put4, ii, -1, -2, 96, 42, -7, 0, 0, -1, 5, 5, -1, 0, 0)
CAVS_SUBPIX_HV(put_, op_put4, kk, 0, -7, 42, 96, -2, -1, 0, -1, 5, 5, -1, 0, 0)
CAVS_SUBPIX_HV(put_, op_put4, qq, 0, -1, 5, 5, -1, 0, 0, -7, 42, 96, -2,-1, 0)
CAVS_SUBPIX_HV(put_, op_put2, egpr, 0, -1, 5, 5, -1, 0, 0, -1, 5, 5, -1, 0, 1)
Reported by Cppcheck.
Line: 535
CWE codes:
682
CAVS_SUBPIX(avg_ , op_avg1, hpel, 0, -1, 5, 5, -1, 0)
CAVS_SUBPIX(avg_ , op_avg2, qpel_l, -1, -2, 96, 42, -7, 0)
CAVS_SUBPIX(avg_ , op_avg2, qpel_r, 0, -7, 42, 96, -2, -1)
CAVS_SUBPIX_HV(avg_, op_avg3, jj, 0, -1, 5, 5, -1, 0, 0, -1, 5, 5, -1, 0, 0)
CAVS_SUBPIX_HV(avg_, op_avg4, ff, 0, -1, 5, 5, -1, 0, -1, -2, 96, 42, -7, 0, 0)
CAVS_SUBPIX_HV(avg_, op_avg4, ii, -1, -2, 96, 42, -7, 0, 0, -1, 5, 5, -1, 0, 0)
CAVS_SUBPIX_HV(avg_, op_avg4, kk, 0, -7, 42, 96, -2, -1, 0, -1, 5, 5, -1, 0, 0)
CAVS_SUBPIX_HV(avg_, op_avg4, qq, 0, -1, 5, 5, -1, 0, 0, -7, 42, 96, -2,-1, 0)
CAVS_SUBPIX_HV(avg_, op_avg2, egpr, 0, -1, 5, 5, -1, 0, 0, -1, 5, 5, -1, 0, 1)
Reported by Cppcheck.
libavformat/gifdec.c
2 issues
Line: 271
Column: 14
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
int packed_fields, block_label, ct_size,
keyframe, frame_parsed = 0, ret;
int64_t frame_start = avio_tell(pb), frame_end;
unsigned char buf[6];
if ((ret = avio_read(pb, buf, 6)) == 6) {
keyframe = memcmp(buf, gif87a_sig, 6) == 0 ||
memcmp(buf, gif89a_sig, 6) == 0;
} else if (ret < 0) {
Reported by FlawFinder.
Line: 242
Column: 24
CWE codes:
126
if (ret < 0 || !sb_size)
return ret;
if (sb_size == strlen(NETSCAPE_EXT_STR)) {
sb_size = avio_r8(pb);
ret = avio_read(pb, data, sb_size);
if (ret < 0 || !sb_size)
return ret;
Reported by FlawFinder.
libavfilter/f_perms.c
1 issues
Line: 75
Column: 14
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
}
enum perm { RO, RW };
static const char * const perm_str[2] = { "RO", "RW" };
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
int ret;
AVFilterContext *ctx = inlink->dst;
Reported by FlawFinder.
compat/w32pthreads.h
1 issues
Line: 63
Column: 9
CWE codes:
Suggestion:
Use InitializeCriticalSectionAndSpinCount instead
#define PTHREAD_MUTEX_INITIALIZER SRWLOCK_INIT
#define PTHREAD_COND_INITIALIZER CONDITION_VARIABLE_INIT
#define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
#define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
#define PTHREAD_CANCEL_ENABLE 1
#define PTHREAD_CANCEL_DISABLE 0
Reported by FlawFinder.
doc/examples/avio_reading.c
1 issues
Line: 52
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
printf("ptr:%p size:%zu\n", bd->ptr, bd->size);
/* copy internal buffer data to buf */
memcpy(buf, bd->ptr, buf_size);
bd->ptr += buf_size;
bd->size -= buf_size;
return buf_size;
}
Reported by FlawFinder.
doc/examples/encode_audio.c
1 issues
Line: 176
Column: 9
CWE codes:
362
exit(1);
}
f = fopen(filename, "wb");
if (!f) {
fprintf(stderr, "Could not open %s\n", filename);
exit(1);
}
Reported by FlawFinder.
doc/examples/encode_video.c
1 issues
Line: 133
Column: 9
CWE codes:
362
exit(1);
}
f = fopen(filename, "wb");
if (!f) {
fprintf(stderr, "Could not open %s\n", filename);
exit(1);
}
Reported by FlawFinder.
doc/examples/filter_audio.c
1 issues
Line: 156
Column: 5
CWE codes:
134
Suggestion:
Use a constant for the format specification
/* A third way of passing the options is in a string of the form
* key1=value1:key2=value2.... */
snprintf(options_str, sizeof(options_str),
"sample_fmts=%s:sample_rates=%d:channel_layouts=0x%"PRIx64,
av_get_sample_fmt_name(AV_SAMPLE_FMT_S16), 44100,
(uint64_t)AV_CH_LAYOUT_STEREO);
err = avfilter_init_str(aformat_ctx, options_str);
if (err < 0) {
Reported by FlawFinder.
doc/examples/http_multiclient.c
1 issues
Line: 46
Column: 25
CWE codes:
126
av_opt_get(client, "resource", AV_OPT_SEARCH_CHILDREN, &resource);
// check for strlen(resource) is necessary, because av_opt_get()
// may return empty string.
if (resource && strlen(resource))
break;
av_freep(&resource);
}
if (ret < 0)
goto end;
Reported by FlawFinder.
doc/examples/hw_decode.c
1 issues
Line: 226
Column: 19
CWE codes:
362
}
/* open the file to dump raw data */
output_file = fopen(argv[3], "w+b");
/* actual decoding and dump the raw data */
while (ret >= 0) {
if ((ret = av_read_frame(input_ctx, &packet)) < 0)
break;
Reported by FlawFinder.