Safer conversion of boolean values in ASF attributes.

Technically, boolean values in Extended Content Description Object is not necessarily be 0 or 1.
This commit is contained in:
Tsuda Kageyu
2016-12-19 10:37:10 +09:00
parent a19a623d4b
commit 8905e7095a

View File

@ -217,10 +217,10 @@ String ASF::Attribute::parse(ASF::File &f, int kind)
case BoolType:
if(kind == 0) {
d->boolValue = (readDWORD(&f) == 1);
d->boolValue = (readDWORD(&f) != 0);
}
else {
d->boolValue = (readWORD(&f) == 1);
d->boolValue = (readWORD(&f) != 0);
}
break;