diff --git a/libavformat/xwma.c b/libavformat/xwma.c index 9edad7d75a..3e62a805aa 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -178,6 +178,10 @@ static int xwma_read_header(AVFormatContext *s) } for (i = 0; i < dpds_table_size; ++i) { + if (avio_feof(pb)) { + ret = AVERROR_INVALIDDATA; + goto fail; + } dpds_table[i] = avio_rl32(pb); size -= 4; }