Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
if (size <= 0)
return AVERROR_INVALIDDATA;
if (size <= 0)
return AVERROR_INVALIDDATA;
- *laces = *data + 1;
- data += 1;
- size -= 1;
+ *laces = *data + 1;
+ data += 1;
+ size -= 1;
switch (type) {
case 0x1: /* Xiph lacing */
switch (type) {
case 0x1: /* Xiph lacing */
for (n = 0; n < *laces - 1; n++) {
lace_size[n] = 0;
for (n = 0; n < *laces - 1; n++) {
lace_size[n] = 0;
- while (1) {
- if (size <= total) {
+ do {
+ if (size <= total)
return AVERROR_INVALIDDATA;
return AVERROR_INVALIDDATA;
temp = *data;
total += temp;
lace_size[n] += temp;
data += 1;
size -= 1;
temp = *data;
total += temp;
lace_size[n] += temp;
data += 1;
size -= 1;
- if (temp != 0xff)
- break;
- }
+ } while (temp == 0xff);
return AVERROR_INVALIDDATA;
return AVERROR_INVALIDDATA;
lace_size[n] = size - total;
break;
}
case 0x2: /* fixed-size lacing */
lace_size[n] = size - total;
break;
}
case 0x2: /* fixed-size lacing */
return AVERROR_INVALIDDATA;
return AVERROR_INVALIDDATA;
for (n = 0; n < *laces; n++)
lace_size[n] = size / *laces;
break;
for (n = 0; n < *laces; n++)
lace_size[n] = size / *laces;
break;
}
data += offset;
size -= offset;
}
data += offset;
size -= offset;
return AVERROR_INVALIDDATA;
return AVERROR_INVALIDDATA;
lace_size[*laces - 1] = size - total;
break;
}
}
lace_size[*laces - 1] = size - total;
break;
}
}