Open Session: Fixing problem with previous commit where valid format file was also declared invalid/unkonwn

This commit is contained in:
Srivats P 2016-05-17 22:16:52 +05:30
parent ba754c1043
commit 8bea5636ab

View File

@ -425,12 +425,16 @@ bool NativeFileFormat::isNativeFileFormat(
goto _close_exit;
if (magic.value() == kFileMagicValue) {
OstProto::FileMetaData meta;
OstProto::FileMeta meta;
int metaSize = fileMetaSize((quint8*)buf.constData(), buf.size());
buf = file.peek(kFileMagicOffset + kFileMagicSize + metaSize);
if (!meta.ParseFromArray(
(void*)(buf.constData() + kFileMetaDataOffset),
fileMetaSize((quint8*)buf.constData(), buf.size())))
(void*)(buf.constData() + kFileMetaDataOffset), metaSize)) {
qDebug("%s: File MetaData\n%s", __FUNCTION__,
QString().fromStdString(meta.DebugString()).toAscii().constData());
goto _close_exit;
if (meta.file_type() == fileType)
}
if (meta.data().file_type() == fileType)
ret = true;
}