diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-07-01 10:01:28 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-07-02 20:05:47 +0200 |
commit | daeb4e3042f2ecae2d41aaa4cae0bed932539788 (patch) | |
tree | ad711de4d660f219c50a1918b787c6b2ecbd395f /libavcodec/jpeg2000.c | |
parent | 589e5b52f634f6b2d307a167a19eef7e7328cb08 (diff) | |
download | ffmpeg-daeb4e3042f2ecae2d41aaa4cae0bed932539788.tar.gz |
jpeg2000: Proper cleanup on failure in decode_frame()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r-- | libavcodec/jpeg2000.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index 66f7bed94b..bf46398361 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -484,7 +484,9 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty) { int reslevelno, bandno, precno; - for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++) { + for (reslevelno = 0; + comp->reslevel && reslevelno < codsty->nreslevels; + reslevelno++) { Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno; for (bandno = 0; bandno < reslevel->nbands; bandno++) { |