Allow decoding of slightly broken Nikon avi files.

Fixes ticket #3330.
(cherry picked from commit f9c2d4d17e)

Conflicts:
	libavformat/avidec.c
This commit is contained in:
Carl Eugen Hoyos
2014-01-20 22:37:18 +01:00
parent b902ba478c
commit 4fdcb1e1b7

View File

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