]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/tiff.c
mp3dec: ask for 8khz switch point mp3s
[ffmpeg] / libavcodec / tiff.c
index 26401b15094dc7bb1e79dbe36b184091ad71e974..579bd0d5f70320e6b82620860887ddabe3245e50 100644 (file)
@@ -207,14 +207,17 @@ static char *doubles2str(double *dp, int count, const char *sep)
 {
     int i;
     char *ap, *ap0;
+    int component_len = 15 + strlen(sep);
     if (!sep) sep = ", ";
-    ap = av_malloc((15 + strlen(sep)) * count);
+    ap = av_malloc(component_len * count);
     if (!ap)
         return NULL;
     ap0   = ap;
     ap[0] = '\0';
     for (i = 0; i < count; i++) {
-        int l = snprintf(ap, 15 + strlen(sep), "%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';
@@ -1005,6 +1008,8 @@ static int decode_frame(AVCodecContext *avctx,
         return -1;
     }
     s->le = le;
+    // TIFF_BPP is not a required tag and defaults to 1
+    s->bppcount = s->bpp = 1;
     s->invert = 0;
     s->compr = TIFF_RAW;
     s->fill_order = 0;