X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ftiff.c;h=fdcd9374a1a6c318d53f8ae99194477bcbd6059d;hb=51e9d2dbc8f8e7aed216222a496cc7e588afa217;hp=d5fba7ea6f9e9d7ef83bc0812ca4d2f4782e400c;hpb=ed8ff70d9ee02b9940803aee69462da548df663b;p=ffmpeg diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index d5fba7ea6f9..fdcd9374a1a 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -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);