]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/tiff.c
aasc: fix 16bpp on big-endian
[ffmpeg] / libavcodec / tiff.c
index d5fba7ea6f9e9d7ef83bc0812ca4d2f4782e400c..fdcd9374a1a6c318d53f8ae99194477bcbd6059d 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);