summaryrefslogtreecommitdiffstats
path: root/libavcodec/diracdec.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-07-13 23:40:06 +0100
committerRostislav Pehlivanov <atomnuker@gmail.com>2016-07-13 23:40:06 +0100
commitb2b12b2d4ab1347e06770bfb4ea1bdf1b1c70527 (patch)
tree27ba01c921d352ccd53493e92c6efadb20315a22 /libavcodec/diracdec.c
parent9c0aba434e774f9d8d99d6d3c4adc8dcabf3a052 (diff)
downloadffmpeg-streaming-b2b12b2d4ab1347e06770bfb4ea1bdf1b1c70527.zip
ffmpeg-streaming-b2b12b2d4ab1347e06770bfb4ea1bdf1b1c70527.tar.gz
diracdec: fix maximum quantization index checks
Found by Coverity, fixes CID1363961 and CID1363962 Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r--libavcodec/diracdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 9275c50..dc42a42 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -513,7 +513,7 @@ static inline void codeblock(DiracContext *s, SubBand *b,
b->quant = quant;
}
- if (b->quant > DIRAC_MAX_QUANT_INDEX) {
+ if (b->quant > (DIRAC_MAX_QUANT_INDEX - 1)) {
av_log(s->avctx, AV_LOG_ERROR, "Unsupported quant %d\n", b->quant);
b->quant = 0;
return;
@@ -703,7 +703,7 @@ static void decode_subband(DiracContext *s, GetBitContext *gb, int quant,
uint8_t *buf2 = b2 ? b2->ibuf + top * b2->stride: NULL;
int x, y;
- if (quant > DIRAC_MAX_QUANT_INDEX) {
+ if (quant > (DIRAC_MAX_QUANT_INDEX - 1)) {
av_log(s->avctx, AV_LOG_ERROR, "Unsupported quant %d\n", quant);
return;
}
OpenPOWER on IntegriCloud