Browse Source

avformat/mvdec: check for EOF

Fixes #6805.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n4.0
Paul B Mahol 8 years ago
parent
commit
3f4fccf4d6
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      libavformat/mvdec.c

+ 7
- 1
libavformat/mvdec.c View File

@@ -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);


Loading…
Cancel
Save