Browse Source

tiff: fix leak on error return in doubles2str()

Fixes CID733797
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
4b20b21b8d
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/tiff.c

+ 3
- 1
libavcodec/tiff.c View File

@@ -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';


Loading…
Cancel
Save