~ubuntu-branches/ubuntu/saucy/libraw/saucy

« back to all changes in this revision

Viewing changes to samples/4channels.cpp

  • Committer: Package Import Robot
  • Author(s): Luca Falavigna
  • Date: 2013-07-10 21:20:09 UTC
  • mfrom: (0.5.1 sid)
  • Revision ID: package-import@ubuntu.com-20130710212009-nbd5ri057jlsekey
Tags: 0.15.3-1
* Team upload to unstable.
* New upstream release (Closes: #710353).
  - Fix error handling for broken full-color images - CVE-2013-2126.
  - Fix wrong data_maximum calcluation - CVE-2013-2127.
* debian/patches/4channels_parameter.patch:
  - Fix segmentaition fault when 4channel is passed -s option without
     any parameter (Closes: #715577).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- C++ -*-
2
2
 * File: 4channels.cpp
3
 
 * Copyright 2008-2011 LibRaw LLC (info@libraw.org)
 
3
 * Copyright 2008-2013 LibRaw LLC (info@libraw.org)
4
4
 * Created: Mon Feb 09, 2009
5
5
 *
6
6
 * LibRaw sample
48
48
        {
49
49
          usage:
50
50
            printf(
51
 
                "4channeld - LibRaw %s sample. %d cameras supported\n"
 
51
                "4channels - LibRaw %s sample. %d cameras supported\n"
52
52
                "Usage: %s [-s N] [-g] [-A] [-B] [-N] raw-files....\n"
53
53
                "\t-s N - select Nth image in file (default=0)\n"
54
54
                "\t-g - use gamma correction with gamma 2.2 (not precise,use for visual inspection only)\n"
67
67
#define P2 RawProcessor.imgdata.other
68
68
#define OUT RawProcessor.imgdata.params
69
69
 
70
 
    OUT.document_mode=2;
71
70
    OUT.output_bps=16;
72
71
    OUT.output_tiff=1;
73
72
    OUT.user_flip=0;
81
80
                    if(av[i][1]=='s' && av[i][2]==0)
82
81
                        {
83
82
                            i++;
84
 
                            OUT.shot_select=atoi(av[i]);
 
83
                            OUT.shot_select=av[i]?atoi(av[i]):0;
85
84
                        }
86
85
                    else if(av[i][1]=='g' && av[i][2]==0)
87
86
                        use_gamma = 1;