aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-08 22:52:14 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-08 23:19:30 +0100
commit9889762a9bdbb80efb79053ffb6f8fb9ecb4a5f8 (patch)
tree074dbb42fca55ff1ad982ad34a4efb396d05cd31
parent1b47760bbeb6dbe17b9377bd50426df2436d35b6 (diff)
parentae5e1f3d663a8c9a532d89e588cbc61f171c9186 (diff)
downloadffmpeg-9889762a9bdbb80efb79053ffb6f8fb9ecb4a5f8.tar.gz
Merge commit 'ae5e1f3d663a8c9a532d89e588cbc61f171c9186'
* commit 'ae5e1f3d663a8c9a532d89e588cbc61f171c9186': tiff: Check that there is no aliasing in pixel format selection See: e1c0cfaa419aa5d320540d5a1b3f8fd9b82ab7e5 Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/tiff.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 4fe1168774..fe45cac743 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -658,6 +658,14 @@ static int init_image(TiffContext *s, ThreadFrame *frame)
int ret;
int create_gray_palette = 0;
+ // make sure there is no aliasing in the following switch
+ if (s->bpp >= 100 || s->bppcount >= 10) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Unsupported image parameters: bpp=%d, bppcount=%d\n",
+ s->bpp, s->bppcount);
+ return AVERROR_INVALIDDATA;
+ }
+
switch (s->planar * 1000 + s->bpp * 10 + s->bppcount) {
case 11:
if (!s->palette_is_set) {