Browse Source

Coverity scan found we didn't check return for inflateInit() in zlib

pull/652/head
danblooomberg 3 years ago
parent
commit
c1ee126afa
  1. 1
      src/skew.c
  2. 10
      src/zlibmem.c
  3. 2
      version-notes.html

1
src/skew.c

@ -160,7 +160,6 @@ static const l_int32 DefaultBinaryThreshold = 130;
* (1) This binarizes if necessary and does both horizontal
* and vertical deskewing, using the default parameters in
* the underlying pixDeskew(). See usage there.
* (2) This may return a clone.
* </pre>
*/
PIX *

10
src/zlibmem.c

@ -122,7 +122,6 @@ z_stream z;
z.zalloc = (alloc_func)0;
z.zfree = (free_func)0;
z.opaque = (voidpf)0;
z.next_in = bufferin;
z.avail_in = 0;
z.next_out = bufferout;
@ -222,14 +221,17 @@ z_stream z;
z.zalloc = (alloc_func)0;
z.zfree = (free_func)0;
z.next_in = bufferin;
z.avail_in = 0;
z.next_out = bufferout;
z.avail_out = L_BUF_SIZE;
inflateInit(&z);
status = inflateInit(&z);
if (status != Z_OK) {
L_ERROR("inflateInit fail for buffer\n", __func__);
success = FALSE;
goto cleanup_arrays;
}
for ( ; ; ) {
if (z.avail_in == 0) {

2
version-notes.html

@ -114,6 +114,8 @@ They are <i>not</i> a complete listing of the modifications.
pix_internal.h, array_internal.h and ccbord_internal.h.
* Increase the .so number from 5.4.0 to 6.0.0.
* Rename the autotools generated libraries from liblept to libleptonica
* Fix potential memory leaks from recogAverageSamples() and
recogDebugAverages() by not destroying a recog.
1.82.0 Sept 22, 2021
* Fix issue-585: reading tiff rgb with tiffbpl = 1.5 * packedbpl.

Loading…
Cancel
Save