#813: Corrected a minor size glitche in riffvideo.cpp

v0.27.3
Abhinav Badola 13 years ago
parent 14aa8806d8
commit 4c45d2563b

@ -356,10 +356,12 @@ namespace Exiv2 {
std::memset(buf.pData_, 0x0, buf.size_);
io_->read(buf.pData_, 8);
size = static_cast<long>(getUint64_t(buf));
size = static_cast<unsigned long>(getUint64_t(buf));
if(tv)
if(tv) {
std::cerr<<"\n"<<std::setw(40)<<tv->label_<<"=>"<<std::setw(5)<<size;
tagDecoder(tv,size-24);
}
else
io_->seek(cur_pos + size, BasicIo::beg);

@ -548,6 +548,7 @@ namespace Exiv2 {
if (skip && !ignore) return;
const uint64_t bufMinSize = 200;
#ifndef SUPPRESS_WARNINGS
if (!ignore && size > bufMinSize) {
EXV_WARNING << "Size " << size << " of Matroska tag 0x"

@ -535,11 +535,12 @@ namespace Exiv2 {
@return Returns true, if Tag is found in the ignoreList[]
*/
bool dataIgnoreList (Exiv2::DataBuf& buf) {
const char ignoreList[7][5] = {
const char ignoreList[8][5] = {
"moov", "mdia", "minf", "dinf", "alis", "stbl", "cmov",
"meta",
};
for(int i = 0 ; i < 7 ; ++i)
for(int i = 0 ; i < 8 ; ++i)
if(equalsQTimeTag(buf, ignoreList[i]))
return true;
@ -666,7 +667,7 @@ namespace Exiv2 {
io_->read(buf.pData_, 4);
if(size < 8)
return;
// std::cerr<<"\n("<<std::setw(5)<<size<<") :" << buf.pData_;
std::cerr<<"\n("<<std::setw(5)<<size<<") :" << buf.pData_;
tagDecoder(buf,size-8);
} // QuickTimeVideo::decodeBlock
@ -717,6 +718,9 @@ namespace Exiv2 {
else if (equalsQTimeTag(buf, "tapt"))
trackApertureTagDecoder(size);
else if (equalsQTimeTag(buf, "keys"))
keysTagDecoder(size);
else if (equalsQTimeTag(buf, "url ")) {
io_->read(buf.pData_, size);
if (currentStream_ == Video)
@ -745,7 +749,7 @@ namespace Exiv2 {
}
else {
// std::cerr<<" Unprocessed";
std::cerr<<" Unprocessed";
discard(size);
}
} // QuickTimeVideo::tagDecoder
@ -774,6 +778,24 @@ namespace Exiv2 {
io_->seek(cur_pos + size, BasicIo::beg);
} // QuickTimeVideo::previewTagDecoder
void QuickTimeVideo::keysTagDecoder(unsigned long size)
{
DataBuf buf(4);
uint64_t cur_pos = io_->tell();
io_->read(buf.pData_, 4);
xmpData_["Xmp.video.PreviewDate"] = getULong(buf.pData_, bigEndian);
io_->read(buf.pData_, 2);
xmpData_["Xmp.video.PreviewVersion"] = getShort(buf.pData_, bigEndian);
io_->read(buf.pData_, 4);
if(equalsQTimeTag(buf, "PICT"))
xmpData_["Xmp.video.PreviewAtomType"] = "QuickDraw Picture";
else
xmpData_["Xmp.video.PreviewAtomType"] = Exiv2::toString(buf.pData_);
io_->seek(cur_pos + size, BasicIo::beg);
} // QuickTimeVideo::keysTagDecoder
void QuickTimeVideo::trackApertureTagDecoder(unsigned long size)
{
DataBuf buf(4), buf2(2);
@ -878,7 +900,7 @@ namespace Exiv2 {
td = find(userDatatags, Exiv2::toString( buf.pData_));
tv = find(userDataReferencetags, Exiv2::toString( buf.pData_));
// std::cerr<<" =>("<<size<<") "<<buf.pData_;
std::cerr<<" =>("<<size<<") "<<buf.pData_;
if(size == 0 || (size - 12) <= 0)
break;

@ -161,6 +161,12 @@ namespace Exiv2 {
@param size Size of the data block used to store Tag Information.
*/
void previewTagDecoder(unsigned long size);
/*!
@brief Interpret Meta Keys Tags, and save it
in the respective XMP container.
@param size Size of the data block used to store Tag Information.
*/
void keysTagDecoder(unsigned long size);
/*!
@brief Interpret Track Aperture Tags, and save it
in the respective XMP container.

@ -537,7 +537,7 @@ namespace Exiv2 {
const long bufMinSize = 4;
DataBuf buf(bufMinSize);
buf.pData_[3] = '\0';
buf.pData_[4] = '\0';
io_->read(buf.pData_, bufMinSize);
xmpData_["Xmp.video.Container"] = buf.pData_;

Loading…
Cancel
Save