Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed error handling for broken full-color images
  • Loading branch information
alextutubalin committed May 24, 2013
1 parent 3fd4d13 commit c14ae36
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Changelog.rus
@@ -1,4 +1,8 @@
2013-05-21 Alex Tutubalin <lexa@lexa.ru>
2013-05-31 Alex Tutubalin <lexa@lexa.ru>
* Исправлена ошибка при обработке поврежденных полноцветных
файлов (sRAW, Foveon)

2013-05-21 Alex Tutubalin <lexa@lexa.ru>
* Исправлена ошибка в коде функции sony_decrypt(), приводившая
к неверному чтению камерного баланса белого на камерах Sony
если LibRaw была собрана gcc 4.8
Expand Down
4 changes: 4 additions & 0 deletions Changelog.txt
@@ -1,3 +1,7 @@
2013-05-31 Alex Tutubalin <lexa@lexa.ru>
* Fixed double call to free() on broken legacy-layout images
(backport from 0.15.x)

2013-05-21 Alex Tutubalin <lexa@lexa.ru>
* Fixed undefined behaviour in sony_decrypt() function.
This bug causes incorrect camera WB read for Sony cameras.
Expand Down
8 changes: 4 additions & 4 deletions src/libraw_cxx.cpp
Expand Up @@ -796,8 +796,8 @@ int LibRaw::unpack(void)
S.iheight= S.height;
IO.shrink = 0;
// allocate image as temporary buffer, size
imgdata.rawdata.raw_alloc = calloc(S.iwidth*S.iheight,sizeof(*imgdata.image));
imgdata.image = (ushort (*)[4]) imgdata.rawdata.raw_alloc;
imgdata.rawdata.raw_alloc = 0;
imgdata.image = (ushort (*)[4]) calloc(S.iwidth*S.iheight,sizeof(*imgdata.image));
}


Expand All @@ -807,8 +807,8 @@ int LibRaw::unpack(void)
// recover saved
if( decoder_info.decoder_flags & LIBRAW_DECODER_LEGACY)
{
imgdata.image = 0;
imgdata.rawdata.color_image = (ushort (*)[4]) imgdata.rawdata.raw_alloc;
imgdata.rawdata.raw_alloc = imgdata.rawdata.color_image = imgdata.image;
imgdata.image = 0;
}

// calculate channel maximum
Expand Down

0 comments on commit c14ae36

Please sign in to comment.