aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-09 14:41:18 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-09 14:41:18 +0200
commit17f9626b5dd86085a155922221f41338bc8bba1f (patch)
tree8e397c5d044573ba74b5f3da5b0cb9fe62f005e1
parent0196bc6f140d47ec0dd3e411eaefbba4cd152349 (diff)
downloadffmpeg-17f9626b5dd86085a155922221f41338bc8bba1f.tar.gz
tiff/doubles2str: check for truncation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/tiff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index b0ffd7bf61..078c29a541 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -215,7 +215,9 @@ static char *doubles2str(double *dp, int count, const char *sep)
ap0 = ap;
ap[0] = '\0';
for (i = 0; i < count; i++) {
- int l = snprintf(ap, component_len, "%f%s", dp[i], sep);
+ unsigned l = snprintf(ap, component_len, "%f%s", dp[i], sep);
+ if(l >= component_len)
+ return NULL;
ap += l;
}
ap0[strlen(ap0) - strlen(sep)] = '\0';