Skip to content

Commit

Permalink
lmmse_interpolate allocation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alextutubalin committed Nov 27, 2010
1 parent 693f7fe commit ffad73b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Changelog
@@ -1,3 +1,8 @@
2010-11-27 Alex Tutubalin <lexa@lexa.ru>
* fixed bug with allocation size in lmmse_interpolate
* changed malloc to calloc to make valgrind happy with uninitialized
values

2010-11-20 Alex Tutubalin <lexa@lexa.ru>
* OpenMP with LIBRAW_USE_OPENMP

Expand Down
4 changes: 2 additions & 2 deletions lmmse_interpolate.c
Expand Up @@ -35,9 +35,9 @@ void CLASS lmmse_interpolate(int gamma_apply)
rr1 = height + 2*ba;
cc1 = width + 2*ba;
if (gamma_apply)
buffer = (char *)malloc(rr1*cc1*24+65535*4);
buffer = (char *)calloc(rr1*cc1*6*sizeof(float)+65536*sizeof(float),1);
else
buffer = (char *)malloc(rr1*cc1*24);
buffer = (char *)calloc(rr1*cc1*6*sizeof(float),1);
merror(buffer,"lmmse_interpolate()");
qix = (float (*)[6])buffer;
if (gamma_apply) {
Expand Down

0 comments on commit ffad73b

Please sign in to comment.