aboutsummaryrefslogtreecommitdiff
path: root/image/codecs/indeo
diff options
context:
space:
mode:
Diffstat (limited to 'image/codecs/indeo')
-rw-r--r--image/codecs/indeo/get_bits.cpp3
-rw-r--r--image/codecs/indeo/indeo.cpp4
-rw-r--r--image/codecs/indeo/indeo.h4
-rw-r--r--image/codecs/indeo/mem.cpp4
-rw-r--r--image/codecs/indeo/mem.h1
5 files changed, 9 insertions, 7 deletions
diff --git a/image/codecs/indeo/get_bits.cpp b/image/codecs/indeo/get_bits.cpp
index 60c82c4607..ade4baaa81 100644
--- a/image/codecs/indeo/get_bits.cpp
+++ b/image/codecs/indeo/get_bits.cpp
@@ -21,6 +21,7 @@
*/
#include "image/codecs/indeo/get_bits.h"
+#include "image/codecs/indeo/mem.h"
#include "common/algorithm.h"
#include "common/endian.h"
#include "common/textconsole.h"
@@ -158,7 +159,7 @@ static uint zeroExtend(uint val, uint bits) {
}
GetBits::GetBits(const byte *buffer, size_t totalBits) {
- assert(buffer && totalBits < (INT_MAX - 7));
+ assert(buffer && totalBits < (MAX_INTEGER - 7));
_buffer = buffer;
_sizeInBits = totalBits;
diff --git a/image/codecs/indeo/indeo.cpp b/image/codecs/indeo/indeo.cpp
index 69b9f4289b..2c11a09883 100644
--- a/image/codecs/indeo/indeo.cpp
+++ b/image/codecs/indeo/indeo.cpp
@@ -1304,7 +1304,7 @@ int IndeoDecoderBase::ivi_decode_coded_blocks(GetBits *gb, IVIBandDesc *band,
col_flags[pos & col_mask] |= !!val;
}
- if (scan_pos < 0 || scan_pos >= num_coeffs && sym != rvmap->eob_sym)
+ if (scan_pos < 0 || (scan_pos >= num_coeffs && sym != rvmap->eob_sym))
return -1; // corrupt block data
// undoing DC coeff prediction for intra-blocks
@@ -1348,7 +1348,7 @@ int IndeoDecoderBase::ivi_dc_transform(IVIBandDesc *band, int *prev_dc,
/*------------------------------------------------------------------------*/
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx) {
- if (((w + 128) * (uint64)(h + 128)) < (INT_MAX / 8))
+ if (((w + 128) * (uint64)(h + 128)) < (MAX_INTEGER / 8))
return 0;
error("Picture size %ux%u is invalid", w, h);
diff --git a/image/codecs/indeo/indeo.h b/image/codecs/indeo/indeo.h
index d9801202b4..a786995144 100644
--- a/image/codecs/indeo/indeo.h
+++ b/image/codecs/indeo/indeo.h
@@ -113,7 +113,7 @@ struct IVIHuffDesc {
void ivi_huff_desc_copy(const IVIHuffDesc *src);
};
-class IVI45DecContext;
+struct IVI45DecContext;
/**
* macroblock/block huffman table descriptor
@@ -341,7 +341,7 @@ struct AVFrame {
};
struct IVI45DecContext {
- friend class IVIHuffTab;
+ friend struct IVIHuffTab;
private:
VLC_TYPE table_data[8192 * 16][2];
VLC ivi_mb_vlc_tabs[8]; ///< static macroblock Huffman tables
diff --git a/image/codecs/indeo/mem.cpp b/image/codecs/indeo/mem.cpp
index 88085aebdf..9987415799 100644
--- a/image/codecs/indeo/mem.cpp
+++ b/image/codecs/indeo/mem.cpp
@@ -85,13 +85,13 @@ void *av_mallocz(size_t size) {
}
void *av_malloc_array(size_t nmemb, size_t size) {
- if (!size || nmemb >= INT_MAX / size)
+ if (!size || nmemb >= MAX_INTEGER / size)
return nullptr;
return malloc(nmemb * size);
}
void *av_mallocz_array(size_t nmemb, size_t size) {
- if (!size || nmemb >= INT_MAX / size)
+ if (!size || nmemb >= MAX_INTEGER / size)
return NULL;
return av_mallocz(nmemb * size);
diff --git a/image/codecs/indeo/mem.h b/image/codecs/indeo/mem.h
index d3755d652c..cc927e613a 100644
--- a/image/codecs/indeo/mem.h
+++ b/image/codecs/indeo/mem.h
@@ -38,6 +38,7 @@ namespace Indeo {
#define FFALIGN(x, a) (((x) + (a)-1) & ~((a)-1))
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
#define FFSIGN(a) ((a) > 0 ? 1 : -1)
+#define MAX_INTEGER 0x7ffffff
/**
* Allocate a memory block with alignment suitable for all memory accesses