Unified · Split
| @@ -308,7 +308,7 @@ static int add_string_metadata(int count, const char *name, · 307 unmodified lines | |||
| 308 | { | 308 | { |
| 309 | char *value; | 309 | char *value; |
| 310 | 310 | ||
| 311 | if (bytestream2_get_bytes_left(&s->gb) < count) | 311 | if (bytestream2_get_bytes_left(&s->gb) < count || count < 0) |
| 312 | return AVERROR_INVALIDDATA; | 312 | return AVERROR_INVALIDDATA; |
| 313 | 313 | ||
| 314 | value = av_malloc(count + 1); | 314 | value = av_malloc(count + 1); |