The following issues were found
libavcodec/assenc.c
1 issues
Line: 36
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
avctx->extradata = av_malloc(avctx->subtitle_header_size + 1);
if (!avctx->extradata)
return AVERROR(ENOMEM);
memcpy(avctx->extradata, avctx->subtitle_header, avctx->subtitle_header_size);
avctx->extradata_size = avctx->subtitle_header_size;
avctx->extradata[avctx->extradata_size] = 0;
return 0;
}
Reported by FlawFinder.
libavcodec/atrac3plusdec.c
1 issues
Line: 384
Column: 13
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
channels_to_process, avctx);
for (i = 0; i < channels_to_process; i++)
memcpy(samples_p[out_ch_index + i], ctx->outp_buf[i],
ATRAC3P_FRAME_SAMPLES * sizeof(**samples_p));
ch_block++;
out_ch_index += channels_to_process;
}
Reported by FlawFinder.
libavcodec/atsc_a53.c
1 issues
Line: 61
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
sei_data[8] = ((side_data->size/3) & 0x1f) | 0x40;
sei_data[9] = 0;
memcpy(sei_data + 10, side_data->data, side_data->size);
sei_data[side_data->size+10] = 255;
return 0;
}
Reported by FlawFinder.
libavcodec/avcodec.c
1 issues
Line: 343
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
if (!avctx->channels)
avctx->channels = channels;
else if (channels != avctx->channels) {
char buf[512];
av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout);
av_log(avctx, AV_LOG_WARNING,
"Channel layout '%s' with %d channels does not match specified number of channels %d: "
"ignoring specified channel layout\n",
buf, channels, avctx->channels);
Reported by FlawFinder.
libavcodec/bintext.c
1 issues
Line: 159
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return ret;
s->frame->pict_type = AV_PICTURE_TYPE_I;
s->frame->palette_has_changed = 1;
memcpy(s->frame->data[1], s->palette, 16 * 4);
if (avctx->codec_id == AV_CODEC_ID_XBIN) {
while (buf + 2 < buf_end) {
int i,c,a;
int type = *buf >> 6;
Reported by FlawFinder.
libavcodec/bitstream.c
1 issues
Line: 87
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
for (i = 0; put_bits_count(pb) & 31; i++)
put_bits(pb, 8, src[i]);
flush_put_bits(pb);
memcpy(put_bits_ptr(pb), src + i, 2 * words - i);
skip_put_bytes(pb, 2 * words - i);
}
put_bits(pb, bits, AV_RB16(src + 2 * words) >> (16 - bits));
}
Reported by FlawFinder.
libavcodec/bmp.c
1 issues
Line: 315
Column: 17
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
case 24:
case 32:
for (i = 0; i < avctx->height; i++) {
memcpy(ptr, buf, n);
buf += n;
ptr += linesize;
}
break;
case 4:
Reported by FlawFinder.
libavcodec/bmpenc.c
1 issues
Line: 149
Column: 13
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
for(n = 0; n < avctx->width; n++)
AV_WL16(buf + 2 * n, src[n]);
} else {
memcpy(buf, ptr, n_bytes_per_row);
}
buf += n_bytes_per_row;
memset(buf, 0, pad_bytes_per_row);
buf += pad_bytes_per_row;
ptr -= p->linesize[0]; // ... and go back
Reported by FlawFinder.
libavcodec/brenderpix.c
1 issues
Line: 259
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
// TODO: add an AVOption to load custom palette files
av_log(avctx, AV_LOG_WARNING,
"Using default palette, colors might be off.\n");
memcpy(pal_out, std_pal_table, sizeof(uint32_t) * 256);
frame->palette_has_changed = 1;
}
data_len = bytestream2_get_be32(&gb);
Reported by FlawFinder.
libavcodec/bsf.c
1 issues
Line: 453
Column: 15
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
if (options && filter->priv_class) {
const AVOption *opt = av_opt_next(bsf->priv_data, NULL);
const char * shorthand[2] = {NULL};
if (opt)
shorthand[0] = opt->name;
ret = av_opt_set_from_string(bsf->priv_data, options, shorthand, "=", ":");
Reported by FlawFinder.