~ubuntu-branches/debian/lenny/exiv2/lenny

« back to all changes in this revision

Viewing changes to src/olympusmn.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-06-21 08:23:53 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080621082353-b1n4w08trwfwbfl4
Tags: 0.17.1-1
* New upstream release
  - Library transition cleared on debian-release/ d-d-a
* Version 0.17 also fixes:
  - CVE-2008-2696: DoS via metadata in images (Closes: #486328)
  - crashes when fed with wrong file (Closes: #485670)
* Urgency medium for CVE fix
* debian/patches/gcc4.3.diff unecessary for gcc-4.3
* Add /usr/share/bug/exiv2/presubj message for reportbug(1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// ***************************************************************** -*- C++ -*-
2
2
/*
3
 
 * Copyright (C) 2005-2007 Andreas Huggel <ahuggel@gmx.net>
 
3
 * Copyright (C) 2004-2008 Andreas Huggel <ahuggel@gmx.net>
4
4
 *
5
5
 * This program is part of the Exiv2 distribution.
6
6
 *
20
20
 */
21
21
/*
22
22
  File:      olympusmn.cpp
23
 
  Version:   $Rev: 1039 $
 
23
  Version:   $Rev: 1499 $
24
24
  Author(s): Will Stokes (wuz) <wstokes@gmail.com>
25
25
             Andreas Huggel (ahu) <ahuggel@gmx.net>
26
26
             Gilles Caulier (gc) <caulier.gilles@kdemail.net>
30
30
 
31
31
// *****************************************************************************
32
32
#include "rcsid.hpp"
33
 
EXIV2_RCSID("@(#) $Id: olympusmn.cpp 1039 2007-02-02 10:09:31Z ahuggel $")
 
33
EXIV2_RCSID("@(#) $Id: olympusmn.cpp 1499 2008-06-10 03:22:59Z ahuggel $")
34
34
 
35
35
// *****************************************************************************
36
36
// included header files
45
45
#include <sstream>
46
46
#include <iomanip>
47
47
#include <cassert>
 
48
#include <cstring>
48
49
 
49
50
// *****************************************************************************
50
51
// class member definitions
408
409
    {
409
410
        MakerNoteFactory::registerMakerNote("OLYMPUS*", "*", createOlympusMakerNote);
410
411
        MakerNoteFactory::registerMakerNote(olympusIfdId, MakerNote::AutoPtr(new OlympusMakerNote));
411
 
 
412
 
        ExifTags::registerMakerTagInfo(olympusIfdId, tagInfo_);
413
412
    }
414
413
    //! @endcond
415
414
 
433
432
 
434
433
        // Copy the header
435
434
        header_.alloc(8);
436
 
        memcpy(header_.pData_, buf, header_.size_);
 
435
        std::memcpy(header_.pData_, buf, header_.size_);
437
436
        // Adjust the offset of the IFD for the prefix
438
437
        start_ = 8;
439
438
        return 0;
507
506
 
508
507
    std::ostream& OlympusMakerNote::print0x0204(std::ostream& os, const Value& value)
509
508
    {
 
509
        if (   value.count() == 0
 
510
            || value.toRational().second == 0) {
 
511
            return os << "(" << value << ")";
 
512
        }
510
513
        float f = value.toFloat();
511
514
        if (f == 0.0 || f == 1.0) return os << _("None");
512
515
        std::ostringstream oss;