BMessage: fix unflattening from a KMessage buffer

The BDataIO version of MessagePrivate::Unflatten only handles the R5 and
Dano formats, so we must call the buffer version for KMessages.
This commit is contained in:
Adrien Destugues
2015-01-06 17:07:52 +01:00
parent 607dfee24c
commit caf3e27a08
+4
View File
@@ -1274,6 +1274,10 @@ BMessage::Unflatten(const char* flatBuffer)
if (flatBuffer == NULL)
return B_BAD_VALUE;
uint32 format = *(uint32*)flatBuffer;
if (format != MESSAGE_FORMAT_HAIKU)
return BPrivate::MessageAdapter::Unflatten(format, this, flatBuffer);
BMemoryIO io(flatBuffer, SIZE_MAX);
return Unflatten(&io);
}