summaryrefslogtreecommitdiff
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-11 16:51:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-11 16:51:08 +0200
commit4b20b21b8dabc74d676404dea94d43569a54a6b1 (patch)
treec098936ed3530adec6f15efd7d4b01be8eb419ec /libavcodec/tiff.c
parent9ba2484ece532ccca30efba28cab71596a18427d (diff)
tiff: fix leak on error return in doubles2str()
Fixes CID733797 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 1093180d00..bb11a23d19 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -216,8 +216,10 @@ static char *doubles2str(double *dp, int count, const char *sep)
ap[0] = '\0';
for (i = 0; i < count; i++) {
unsigned l = snprintf(ap, component_len, "%f%s", dp[i], sep);
- if(l >= component_len)
+ if(l >= component_len) {
+ av_free(ap0);
return NULL;
+ }
ap += l;
}
ap0[strlen(ap0) - strlen(sep)] = '\0';