aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/jpeg2000.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-07-01 10:01:28 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-02 20:05:47 +0200
commitdaeb4e3042f2ecae2d41aaa4cae0bed932539788 (patch)
treead711de4d660f219c50a1918b787c6b2ecbd395f /libavcodec/jpeg2000.c
parent589e5b52f634f6b2d307a167a19eef7e7328cb08 (diff)
downloadffmpeg-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.c4
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++) {