diff options
author | Sylvain Fabre <sylvain@lahiette.com> | 2014-02-23 13:30:37 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-23 16:03:18 +0400 |
commit | 526049ce61d00ba889c6db8300930c086b3136ef (patch) | |
tree | bb569a7e0a69da7873f1cde44c5be3382a0a4b19 /libavcodec/tiff.c | |
parent | 02b63246cf7f2c38e83defdbba0647ad24be8369 (diff) |
Issue-#3407 : Enhance precision for double to string conversion, useful for GEOTIFF double values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r-- | libavcodec/tiff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 679fd5e053..cbc526acc5 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -195,7 +195,7 @@ static char *doubles2str(double *dp, int count, const char *sep) char *ap, *ap0; uint64_t component_len; if (!sep) sep = ", "; - component_len = 15LL + strlen(sep); + component_len = 24LL + strlen(sep); if (count >= (INT_MAX - 1)/component_len) return NULL; ap = av_malloc(component_len * count + 1); @@ -204,7 +204,7 @@ static char *doubles2str(double *dp, int count, const char *sep) ap0 = ap; ap[0] = '\0'; for (i = 0; i < count; i++) { - unsigned l = snprintf(ap, component_len, "%f%s", dp[i], sep); + unsigned l = snprintf(ap, component_len, "%.15g%s", dp[i], sep); if(l >= component_len) { av_free(ap0); return NULL; |