Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-05-30 11:50:32 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-06-07 02:55:24 +0400
commit9dc14fd3f029c2598e69ada1936345ae314f315f (patch)
tree7436f97b9abac3b75a306b58533e49af5233a831 /libavcodec
parentba2d20b44984654c565130094a4a55bddbccd2a7 (diff)
iff: check if there is extradata
Fixes #1368. Signed-off-by: Paul B Mahol <onemda@gmail.com> (cherry picked from commit 8f61526978697e51d3b9e61ea84daf13c42717af) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/iff.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 8946bf9858..90cafbd370 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -316,7 +316,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
int err;
if (avctx->bits_per_coded_sample <= 8) {
- int palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
+ int palette_size;
+
+ if (avctx->extradata_size >= 2)
+ palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
+ else
+ palette_size = 0;
avctx->pix_fmt = (avctx->bits_per_coded_sample < 8) ||
(avctx->extradata_size >= 2 && palette_size) ? PIX_FMT_PAL8 : PIX_FMT_GRAY8;
} else if (avctx->bits_per_coded_sample <= 32) {