The following issues were found
libavfilter/af_join.c
1 issues
Line: 458
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
frame->pts = s->input_frames[0]->pts;
frame->linesize[0] = linesize;
if (frame->data != frame->extended_data) {
memcpy(frame->data, frame->extended_data, sizeof(*frame->data) *
FFMIN(FF_ARRAY_ELEMS(frame->data), s->nb_channels));
}
s->eof_pts = frame->pts + av_rescale_q(frame->nb_samples,
av_make_q(1, outlink->sample_rate),
Reported by FlawFinder.
libavfilter/af_surround.c
1 issues
Line: 1572
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
ptr = (float *)s->overlap_buffer->extended_data[ch];
dst = (float *)out->extended_data[ch];
memcpy(dst, ptr, s->hop_size * sizeof(float));
return 0;
}
static int filter_frame(AVFilterLink *inlink)
Reported by FlawFinder.
libavfilter/asrc_afirsrc.c
1 issues
Line: 290
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!(frame = ff_get_audio_buffer(outlink, nb_samples)))
return AVERROR(ENOMEM);
memcpy(frame->data[0], s->taps + s->pts, nb_samples * sizeof(float));
frame->pts = s->pts;
s->pts += nb_samples;
return ff_filter_frame(outlink, frame);
}
Reported by FlawFinder.
libavfilter/asrc_hilbert.c
1 issues
Line: 160
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!(frame = ff_get_audio_buffer(outlink, nb_samples)))
return AVERROR(ENOMEM);
memcpy(frame->data[0], s->taps + s->pts, nb_samples * sizeof(float));
frame->pts = s->pts;
s->pts += nb_samples;
return ff_filter_frame(outlink, frame);
}
Reported by FlawFinder.
libavfilter/avfilter.h
1 issues
Line: 599
Column: 5
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
* The fields below this limit are internal for libavfilter's use
* and must in no way be accessed by applications.
*/
char reserved[0xF000];
#else /* FF_INTERNAL_FIELDS */
/**
* Queue of frames waiting to be filtered.
Reported by FlawFinder.
libavfilter/avfiltergraph.c
1 issues
Line: 499
Column: 17
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
AVFilterContext *convert;
const AVFilter *filter;
AVFilterLink *inlink, *outlink;
char inst_name[30];
const char *opts;
if (graph->disable_auto_convert) {
av_log(log_ctx, AV_LOG_ERROR,
"The filters '%s' and '%s' do not have a common format "
Reported by FlawFinder.
libavfilter/convolution.h
1 issues
Line: 35
Column: 5
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
typedef struct ConvolutionContext {
const AVClass *class;
char *matrix_str[4];
float rdiv[4];
float bias[4];
int mode[4];
float scale;
float delta;
Reported by FlawFinder.
libavfilter/dnn/dnn_backend_native.c
1 issues
Line: 121
Column: 5
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
#define DNN_NATIVE_MAGIC "FFMPEGDNNNATIVE"
DNNModel *model = NULL;
// sizeof - 1 to skip the terminating '\0' which is not written in the file
char buf[sizeof(DNN_NATIVE_MAGIC) - 1];
int version, header_size, major_version_expected = 1;
NativeModel *native_model = NULL;
AVIOContext *model_file_context;
int file_size, dnn_size, parsed_size;
int32_t layer;
Reported by FlawFinder.
libavfilter/dnn/dnn_backend_native.h
1 issues
Line: 95
Column: 5
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
/**
* to avoid possible memory leak, do not use char *name
*/
char name[128];
/**
* data pointer with data length in bytes.
* usedNumbersLeft is only valid for intermediate operand,
* it means how many layers still depend on this operand,
Reported by FlawFinder.
compat/getopt.c
1 issues
Line: 41
Column: 12
CWE codes:
120
20
Suggestion:
Check implementation on installation, or limit the size of all string inputs
static int optopt;
static char *optarg;
static int getopt(int argc, char *argv[], char *opts)
{
static int sp = 1;
int c;
char *cp;
Reported by FlawFinder.