[FFmpeg-cvslog] j2kdec: fix division by zero, check tile dimensions for validity
Michael Niedermayer
git at videolan.org
Sat Dec 24 18:53:09 CET 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 24 04:59:25 2011 +0100| [628c9dcca3fb3f46f960f0df8236591653c6e512] | committer: Michael Niedermayer
j2kdec: fix division by zero, check tile dimensions for validity
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=628c9dcca3fb3f46f960f0df8236591653c6e512
---
libavcodec/j2kdec.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c
index 1f4acc5..a8c0c52 100644
--- a/libavcodec/j2kdec.c
+++ b/libavcodec/j2kdec.c
@@ -220,6 +220,9 @@ static int get_siz(J2kDecoderContext *s)
s->tile_offset_y = bytestream_get_be32(&s->buf); // YT0Siz
s->ncomponents = bytestream_get_be16(&s->buf); // CSiz
+ if(s->tile_width<=0 || s->tile_height<=0)
+ return AVERROR(EINVAL);
+
if (s->buf_end - s->buf < 2 * s->ncomponents)
return AVERROR(EINVAL);
More information about the ffmpeg-cvslog
mailing list