aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-08 23:27:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-12 00:47:06 +0100
commit5333edcc869181649d7f9d6cdde9f975531c0b8c (patch)
tree5f7f335f0cbb40b3fdbfddacc591ebde725419aa
parentbd92af66a1f0cfbb2bb6d372dbf1fac7caaa1732 (diff)
downloadffmpeg-5333edcc869181649d7f9d6cdde9f975531c0b8c.tar.gz
avcodec/tiff: move bpp check to after "end:"
This ensures that all current and future code-pathes get bpp checked Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit d5e9fc782150d4596c72440a0aa02b7f4f1254b1) Conflicts: libavcodec/tiff.c
-rw-r--r--libavcodec/tiff.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index d26135ecda..21588e72f8 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -498,6 +498,13 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *
default:
av_log(s->avctx, AV_LOG_DEBUG, "Unknown or unsupported tag %d/0X%0X\n", tag, tag);
}
+ if (s->bpp > 64U) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "This format is not supported (bpp=%d, %d components)\n",
+ s->bpp, count);
+ s->bpp = 0;
+ return AVERROR_INVALIDDATA;
+ }
return 0;
}