As Winfried <handygewinnsp...@gmx.de> pointed, me UTF-8 can have up to 
32 bits.

Also, someone might want to convert data to UCS-4, So, the buffer need to 
have 4 bytes per char, to be safe.

Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>

diff --git a/util/scan/scan.c b/util/scan/scan.c
--- a/util/scan/scan.c
+++ b/util/scan/scan.c
@@ -884,7 +884,7 @@ static void descriptorcpy(char **dest, c
         * Destination length should be bigger. As the worse case seems to
         * use 3 chars for one code, use it for destlen
         */
-       destlen = len * 3;
+       destlen = len * 4;
        *dest = malloc(destlen + 1);
 
        /* Remove special chars */
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to