[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:43:22 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=c6bdee1
The following commit has been merged in the master branch:
commit c6bdee17436d30bc1199a768765af72a720e6330
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Mon Aug 20 16:53:22 2012 +0000
#813: AsfVideo::contentDescription: tweaks, error handling.
---
src/asfvideo.cpp | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/asfvideo.cpp b/src/asfvideo.cpp
index 7e160c6..5cd6f81 100644
--- a/src/asfvideo.cpp
+++ b/src/asfvideo.cpp
@@ -44,6 +44,7 @@ EXIV2_RCSID("@(#) $Id$")
#include <cmath>
#include <cstring>
#include <ctype.h>
+#include <cassert>
// *****************************************************************************
// class member definitions
@@ -170,11 +171,11 @@ namespace Exiv2 {
};
extern const TagDetails contentDescriptionTags[] = {
- { 1, "Xmp.video.Title" },
- { 2, "Xmp.video.Author" },
- { 3, "Xmp.video.Copyright" },
- { 4, "Xmp.video.Description" },
- { 5, "Xmp.video.Rating" }
+ { 0, "Xmp.video.Title" },
+ { 1, "Xmp.video.Author" },
+ { 2, "Xmp.video.Copyright" },
+ { 3, "Xmp.video.Description" },
+ { 4, "Xmp.video.Rating" }
};
/*!
@@ -453,21 +454,22 @@ namespace Exiv2 {
void AsfVideo::contentDescription(uint64_t size)
{
- long pos = io_->tell();
+ const long pos = io_->tell();
+ if (pos == -1) throw Error(14);
long length[5];
- const TagDetails* td;
-
for (int i = 0 ; i < 5 ; ++i) {
byte buf[2];
io_->read(buf, 2);
- length[i] = (long)buf[0] + 16 * (long)buf[1];
+ if (io_->error() || io_->eof()) throw Error(14);
+ length[i] = getUShort(buf, littleEndian);
}
-
for (int i = 0 ; i < 5 ; ++i) {
DataBuf buf(length[i]);
std::memset(buf.pData_, 0x0, buf.size_);
io_->read(buf.pData_, length[i]);
- td = find(contentDescriptionTags, i + 1);
+ if (io_->error() || io_->eof()) throw Error(14);
+ const TagDetails* td = find(contentDescriptionTags, i);
+ assert(td);
std::string str((const char*)buf.pData_, length[i]);
if (convertStringCharset(str, "UCS-2LE", "UTF-8")) {
xmpData_[td->label_] = str;
@@ -476,7 +478,7 @@ namespace Exiv2 {
xmpData_[td->label_] = toString16(buf);
}
}
- io_->seek(pos + size, BasicIo::beg);
+ if (io_->seek(pos + size, BasicIo::beg)) throw Error(14);
} // AsfVideo::contentDescription
void AsfVideo::streamProperties()
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list