[trunk] Fix heap buffer overflow
[openjpeg.git] / libopenjpeg / cio.h
index b276930806e6ef703690eabdb5eccf1630c584a1..1c59e030e86808f074229c5943d4d23e9356b804 100644 (file)
@@ -51,7 +51,7 @@ Number of bytes left before the end of the stream
 @param cio CIO handle
 @return Returns the number of bytes before the end of the stream
 */
-int cio_numbytesleft(opj_cio_t *cio);
+OPJ_SIZE_T cio_numbytesleft(opj_cio_t *cio);
 /**
 Get pointer to the current position in the stream
 @param cio CIO handle
@@ -59,6 +59,12 @@ Get pointer to the current position in the stream
 */
 unsigned char *cio_getbp(opj_cio_t *cio);
 /**
+*/
+opj_bool cio_byteout(opj_cio_t *cio, unsigned char v);
+/**
+*/
+unsigned char cio_bytein(opj_cio_t *cio);
+/**
 Write some bytes
 @param cio CIO handle
 @param v Value to write
@@ -108,6 +114,7 @@ void cio_skip(opj_cio_t *cio, int n);
 
 typedef enum
 {
+       opj_signed_sentinel             = -1, /* do not use in code */
        opj_stream_e_output             = 0x1,
        opj_stream_e_input              = 0x2,
        opj_stream_e_end                = 0x4,
@@ -187,7 +194,7 @@ typedef struct opj_stream_private
        /**
         * Flags to tell the status of the stream.
         */
-       OPJ_UINT32                      m_status;
+       opj_stream_flag m_status;
 
 }
 opj_stream_private_t;