[FFmpeg-cvslog] tiff: fix leak on error return in doubles2str()

Michael Niedermayer git at videolan.org
Thu Oct 11 16:55:44 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 11 16:51:08 2012 +0200| [4b20b21b8dabc74d676404dea94d43569a54a6b1] | committer: Michael Niedermayer

tiff: fix leak on error return in doubles2str()

Fixes CID733797
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b20b21b8dabc74d676404dea94d43569a54a6b1
---

 libavcodec/tiff.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 1093180..bb11a23 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';



More information about the ffmpeg-cvslog mailing list