aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-27 21:02:13 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-06 02:51:26 +0100
commit9ce96a688b180d23f2c6de7d1a90858451af80f8 (patch)
treea3d5f5e9f0db9cbff667bed34f0d13faba26e31d
parent9d5bdca3d8af5dd86d27f300ff19180a295fa934 (diff)
downloadffmpeg-9ce96a688b180d23f2c6de7d1a90858451af80f8.tar.gz
avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit feb3f39614b88c113211a98dda1bc2fe5c3c6957) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/jpeg2000dwt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index 36e443d478..a46c93a9b2 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -580,6 +580,9 @@ int ff_jpeg2000_dwt_init(DWTContext *s, int border[2][2],
int ff_dwt_encode(DWTContext *s, void *t)
{
+ if (s->ndeclevels == 0)
+ return 0;
+
switch(s->type){
case FF_DWT97:
dwt_encode97_float(s, t); break;