avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-11-27 21:02:13 +01:00
parent 75422280fb
commit feb3f39614
1 changed files with 3 additions and 0 deletions

View File

@ -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;