[FFmpeg-devel] [PATCH]Fix demuxing of some Nikon avi files

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Jan 20 00:51:43 CET 2014


Hi!

Attached patch fixes ticket #3330 for me.

Please review, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 1f9fa14..57fbcd7 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -350,6 +350,8 @@ 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 -= avio_read(s->pb, buffer,
                                   FFMIN(size, sizeof(buffer) - 1));
                 switch (tag) {


More information about the ffmpeg-devel mailing list