22// This software is released under the 2-Clause BSD license, included
33// below.
44//
5- // Copyright (c) 2019, Aous Naman
5+ // Copyright (c) 2019, Aous Naman
66// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
77// Copyright (c) 2019, The University of New South Wales, Australia
8- //
8+ //
99// Redistribution and use in source and binary forms, with or without
1010// modification, are permitted provided that the following conditions are
1111// met:
12- //
12+ //
1313// 1. Redistributions of source code must retain the above copyright
1414// notice, this list of conditions and the following disclaimer.
15- //
15+ //
1616// 2. Redistributions in binary form must reproduce the above copyright
1717// notice, this list of conditions and the following disclaimer in the
1818// documentation and/or other materials provided with the distribution.
19- //
19+ //
2020// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
2121// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2222// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
@@ -57,7 +57,9 @@ namespace ojph {
5757 // //////////////////////////////////////////////////////////////////////////
5858 codestream::~codestream ()
5959 {
60- if (state) delete state;
60+ if (state)
61+ delete state;
62+ state = NULL ;
6163 }
6264
6365 // //////////////////////////////////////////////////////////////////////////
@@ -66,6 +68,13 @@ namespace ojph {
6668 state = new local::codestream;
6769 }
6870
71+ // //////////////////////////////////////////////////////////////////////////
72+ void codestream::restart ()
73+ {
74+ assert (state != NULL );
75+ state->restart ();
76+ }
77+
6978 // //////////////////////////////////////////////////////////////////////////
7079 param_siz codestream::access_siz ()
7180 {
@@ -103,7 +112,7 @@ namespace ojph {
103112 }
104113
105114 // //////////////////////////////////////////////////////////////////////////
106- void codestream::set_tilepart_divisions (bool at_resolutions,
115+ void codestream::set_tilepart_divisions (bool at_resolutions,
107116 bool at_components)
108117 {
109118 ui32 value = 0 ;
@@ -147,7 +156,7 @@ namespace ojph {
147156 }
148157
149158 // //////////////////////////////////////////////////////////////////////////
150- void codestream::write_headers (outfile_base *file,
159+ void codestream::write_headers (outfile_base *file,
151160 const comment_exchange* comments,
152161 ui32 num_comments)
153162 {
0 commit comments