avcodec/tiff_common: allow count = 0 in ff_tadd_bytes_metadata()
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 31 Oct 2013 22:29:01 +0000 (23:29 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Nov 2013 18:49:05 +0000 (19:49 +0100)
Fixes Ticket3103

Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/tiff_common.c

index 6a10d71..ce91219 100644 (file)
@@ -219,7 +219,7 @@ int ff_tadd_bytes_metadata(int count, const char *name, const char *sep,
     char *ap;
     int i;
 
-    if (count >= INT_MAX / sizeof(int8_t) || count <= 0)
+    if (count >= INT_MAX / sizeof(int8_t) || count < 0)
         return AVERROR_INVALIDDATA;
     if (bytestream2_get_bytes_left(gb) < count * sizeof(int8_t))
         return AVERROR_INVALIDDATA;