mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 08:12:44 +00:00
avformat/wavenc: do not hardcode array size in memset and other functions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2e1e10a6bb
commit
d34d3304a8
@ -270,13 +270,13 @@ static void peak_write_chunk(AVFormatContext *s)
|
|||||||
if (wav->peak_block_pos)
|
if (wav->peak_block_pos)
|
||||||
peak_write_frame(s);
|
peak_write_frame(s);
|
||||||
|
|
||||||
memset(timestamp, 0, 28);
|
memset(timestamp, 0, sizeof(timestamp));
|
||||||
if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
|
if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
|
||||||
av_log(s, AV_LOG_INFO, "Writing local time and date to Peak Envelope Chunk\n");
|
av_log(s, AV_LOG_INFO, "Writing local time and date to Peak Envelope Chunk\n");
|
||||||
now0 = av_gettime();
|
now0 = av_gettime();
|
||||||
now_secs = now0 / 1000000;
|
now_secs = now0 / 1000000;
|
||||||
strftime(timestamp, 28, "%Y:%m:%d:%H:%M:%S:", localtime(&now_secs));
|
strftime(timestamp, sizeof(timestamp), "%Y:%m:%d:%H:%M:%S:", localtime(&now_secs));
|
||||||
av_strlcatf(timestamp, 28, "%03d", (int)((now0 / 1000) % 1000));
|
av_strlcatf(timestamp, sizeof(timestamp), "%03d", (int)((now0 / 1000) % 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
avio_wl32(pb, 1); /* version */
|
avio_wl32(pb, 1); /* version */
|
||||||
|
Loading…
Reference in New Issue
Block a user