aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-30 21:01:34 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-31 02:22:11 +0200
commita5203d86b36e33af6424df0f0054d4ddad9a3c4f (patch)
treeed335ff2e7031e5b473463be04569209c16aeaab
parentf67f2681da5fe6a1a97674c6855e670fd089c34d (diff)
downloadffmpeg-a5203d86b36e33af6424df0f0054d4ddad9a3c4f.tar.gz
j2kdec: merge length==0 check from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/j2kdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c
index 94341e19bc..74095250f2 100644
--- a/libavcodec/j2kdec.c
+++ b/libavcodec/j2kdec.c
@@ -795,6 +795,10 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
for (y = 0; y < height; y++)
memset(t1->data[y], 0, width * sizeof(**t1->data));
+ /* If code-block contains no compressed data: nothing to do. */
+ if (!cblk->length)
+ return 0;
+
for (y = 0; y < height+2; y++)
memset(t1->flags[y], 0, (width + 2)*sizeof(**t1->flags));