tiff: in add_string_metadata() check the count more completely
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 27 Jan 2013 03:53:03 +0000 (04:53 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 27 Jan 2013 03:53:03 +0000 (04:53 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/tiff.c

index d5fba7e..fdcd937 100644 (file)
@@ -308,7 +308,7 @@ static int add_string_metadata(int count, const char *name,
 {
     char *value;
 
-    if (bytestream2_get_bytes_left(&s->gb) < count)
+    if (bytestream2_get_bytes_left(&s->gb) < count || count < 0)
         return AVERROR_INVALIDDATA;
 
     value = av_malloc(count + 1);