aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mvdec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-11-05 10:39:23 +0100
committerPaul B Mahol <onemda@gmail.com>2017-11-05 10:42:07 +0100
commit3f4fccf4d6d2a9a6db46bfca0e6fb648d8e3708b (patch)
tree450c7933d8bb26346a516eae087679a5079726e9 /libavformat/mvdec.c
parent0ae1f6ddeb350d767a4860e1dcffea9cebe9917c (diff)
downloadffmpeg-3f4fccf4d6d2a9a6db46bfca0e6fb648d8e3708b.tar.gz
avformat/mvdec: check for EOF
Fixes #6805. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/mvdec.c')
-rw-r--r--libavformat/mvdec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index f7aa4cbaec..fa596179ed 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -227,7 +227,9 @@ static int read_table(AVFormatContext *avctx, AVStream *st,
int (*parse)(AVFormatContext *avctx, AVStream *st,
const char *name, int size))
{
- int count, i;
+ unsigned count;
+ int i;
+
AVIOContext *pb = avctx->pb;
avio_skip(pb, 4);
count = avio_rb32(pb);
@@ -235,6 +237,10 @@ static int read_table(AVFormatContext *avctx, AVStream *st,
for (i = 0; i < count; i++) {
char name[17];
int size;
+
+ if (avio_feof(pb))
+ return AVERROR_EOF;
+
avio_read(pb, name, 16);
name[sizeof(name) - 1] = 0;
size = avio_rb32(pb);