Commit d237a30c authored by Petri Hintukainen's avatar Petri Hintukainen

Fix loop condition

parent 85f6b2ce
......@@ -838,8 +838,9 @@ static struct file_entry *_read_file_entry(udfread *udf,
free(buf);
/* read possible additional allocation extents */
if (fe && fe->num_ad > 0) {
while (fe->data.ad[fe->num_ad - 1].extent_type == ECMA_AD_EXTENT_AD) {
if (fe) {
while (fe->num_ad > 0 &&
fe->data.ad[fe->num_ad - 1].extent_type == ECMA_AD_EXTENT_AD) {
icb = &fe->data.ad[fe->num_ad - 1];
udf_log("_read_file_entry: reading allocation extent @%u\n", icb->lba);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment