RIFF file consist of building blocks called chunks. Chunk can be described as the following C structure[2]:
struct chunk {
char id[4]; // four character code describing chunk content unsigned long size; // length of the content, excluding id, size and padding char data[size]; // chunk content, padded to the word boundary};
Chunks having id of either "RIFF" or "LIST" store any number of other chunks.
"RIFF" chunk defines the whole file container. First four bytes of the chunk data form a file type identifier (eg."AVI "[3], "WAVE" etc), after which there are chunks describing the file placed one after another.
"LIST" chunk is just an ordered collection of other chunks, for example a collection of movie frames. First four bytes of the data is a collection identifier (eg."movi" for frame data etc), after which chunks of the collection follow.
To learn more about other chunk types and RIFF format, please refer to the following Microsoft's documents: