aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-09-03 14:18:02 +0200
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-10-19 20:36:55 +0200
commit6871c171735959fb882e43755abbd33a62b14e0c (patch)
tree68fbd4c9cacdc541de4a582701f926bcd66154b7 /libavformat/matroskadec.c
parent10f468156c0109a06854b5d672c5209a88923ce9 (diff)
downloadffmpeg-6871c171735959fb882e43755abbd33a62b14e0c.tar.gz
lavf/matroskadec: Simplify string length calculation.
FFmpeg relies on sizeof(char) == 1.
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e6793988e1..2daa1dba6f 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3931,11 +3931,11 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
// store cue point timestamps as a comma separated list for checking subsegment alignment in
// the muxer. assumes that each timestamp cannot be more than 20 characters long.
- buf = av_malloc_array(s->streams[0]->nb_index_entries, 20 * sizeof(char));
+ buf = av_malloc_array(s->streams[0]->nb_index_entries, 20);
if (!buf) return -1;
strcpy(buf, "");
for (i = 0; i < s->streams[0]->nb_index_entries; i++) {
- int ret = snprintf(buf + end, 20 * sizeof(char),
+ int ret = snprintf(buf + end, 20,
"%" PRId64, s->streams[0]->index_entries[i].timestamp);
if (ret <= 0 || (ret == 20 && i == s->streams[0]->nb_index_entries - 1)) {
av_log(s, AV_LOG_ERROR, "timestamp too long.\n");
@@ -3944,7 +3944,7 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
}
end += ret;
if (i != s->streams[0]->nb_index_entries - 1) {
- strncat(buf, ",", sizeof(char));
+ strncat(buf, ",", 1);
end++;
}
}