diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-09 14:40:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-09 14:40:10 +0200 |
commit | 0196bc6f140d47ec0dd3e411eaefbba4cd152349 (patch) | |
tree | 61cc9c77766ac2b56015264099e7b53707645796 | |
parent | 07108cafc6e8454ef5fd480936a06a59dd24b855 (diff) | |
download | ffmpeg-0196bc6f140d47ec0dd3e411eaefbba4cd152349.tar.gz |
tiff/doubles2str: factor out component_len
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/tiff.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 26401b1509..b0ffd7bf61 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -207,14 +207,15 @@ static char *doubles2str(double *dp, int count, const char *sep) { int i; char *ap, *ap0; + int component_len = 15 + strlen(sep); if (!sep) sep = ", "; - ap = av_malloc((15 + strlen(sep)) * count); + ap = av_malloc(component_len * count); if (!ap) return NULL; ap0 = ap; ap[0] = '\0'; for (i = 0; i < count; i++) { - int l = snprintf(ap, 15 + strlen(sep), "%f%s", dp[i], sep); + int l = snprintf(ap, component_len, "%f%s", dp[i], sep); ap += l; } ap0[strlen(ap0) - strlen(sep)] = '\0'; |