1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

Avoid a possible overflow when reading Nikon avi files.

Suggested-by: Reimar
This commit is contained in:
Carl Eugen Hoyos 2014-01-20 11:40:35 +01:00
parent 9b78abae19
commit b7702fafb3

View File

@ -350,8 +350,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
uint16_t size = avio_rl16(s->pb);
const char *name = NULL;
char buffer[64] = { 0 };
if (avio_tell(s->pb) + size > tag_end)
size = tag_end - avio_tell(s->pb);
size = FFMIN(size, tag_end - avio_tell(s->pb));
size -= avio_read(s->pb, buffer,
FFMIN(size, sizeof(buffer) - 1));
switch (tag) {