tiff: in add_string_metadata() check the count more completely

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/9/head
Michael Niedermayer 12 years ago
parent 5de286ef88
commit b16830840e
  1. 2
      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);

Loading…
Cancel
Save