Commit 212812d8372d01362252bf2ac189c15367ff4f5c
1 parent
66c88995
Fix errors reported by Coverity
Thanks to Jiri Popelka from Red Hat for sending the output of a Coverity run over qpdf.
Showing
3 changed files
with
5 additions
and
1 deletions
libqpdf/QPDFObjectHandle.cc
| @@ -35,6 +35,7 @@ QPDFObjectHandle::ParserCallbacks::terminateParsing() | @@ -35,6 +35,7 @@ QPDFObjectHandle::ParserCallbacks::terminateParsing() | ||
| 35 | 35 | ||
| 36 | QPDFObjectHandle::QPDFObjectHandle() : | 36 | QPDFObjectHandle::QPDFObjectHandle() : |
| 37 | initialized(false), | 37 | initialized(false), |
| 38 | + qpdf(0), | ||
| 38 | objid(0), | 39 | objid(0), |
| 39 | generation(0), | 40 | generation(0), |
| 40 | reserved(false) | 41 | reserved(false) |
libqpdf/QPDFWriter.cc
| @@ -70,6 +70,7 @@ QPDFWriter::init() | @@ -70,6 +70,7 @@ QPDFWriter::init() | ||
| 70 | encryption_V = 0; | 70 | encryption_V = 0; |
| 71 | encryption_R = 0; | 71 | encryption_R = 0; |
| 72 | encryption_dict_objid = 0; | 72 | encryption_dict_objid = 0; |
| 73 | + pipeline = 0; | ||
| 73 | next_objid = 1; | 74 | next_objid = 1; |
| 74 | cur_stream_length_id = 0; | 75 | cur_stream_length_id = 0; |
| 75 | cur_stream_length = 0; | 76 | cur_stream_length = 0; |
| @@ -2695,7 +2696,7 @@ QPDFWriter::writeLinearized() | @@ -2695,7 +2696,7 @@ QPDFWriter::writeLinearized() | ||
| 2695 | 2696 | ||
| 2696 | this->next_objid = part4_first_obj; | 2697 | this->next_objid = part4_first_obj; |
| 2697 | enqueuePart(part4); | 2698 | enqueuePart(part4); |
| 2698 | - assert(this->next_objid = after_part4); | 2699 | + assert(this->next_objid == after_part4); |
| 2699 | this->next_objid = part6_first_obj; | 2700 | this->next_objid = part6_first_obj; |
| 2700 | enqueuePart(part6); | 2701 | enqueuePart(part6); |
| 2701 | assert(this->next_objid == after_part6); | 2702 | assert(this->next_objid == after_part6); |
libtests/flate.cc
| @@ -46,6 +46,7 @@ void run(char const* filename) | @@ -46,6 +46,7 @@ void run(char const* filename) | ||
| 46 | // Write to the both pipeline | 46 | // Write to the both pipeline |
| 47 | def3->write(buf, len); | 47 | def3->write(buf, len); |
| 48 | } | 48 | } |
| 49 | + fclose(in1); | ||
| 49 | 50 | ||
| 50 | def1->finish(); | 51 | def1->finish(); |
| 51 | delete def1; | 52 | delete def1; |
| @@ -69,6 +70,7 @@ void run(char const* filename) | @@ -69,6 +70,7 @@ void run(char const* filename) | ||
| 69 | { | 70 | { |
| 70 | inf2->write(buf, len); | 71 | inf2->write(buf, len); |
| 71 | } | 72 | } |
| 73 | + fclose(in2); | ||
| 72 | 74 | ||
| 73 | inf2->finish(); | 75 | inf2->finish(); |
| 74 | delete inf2; | 76 | delete inf2; |