[FFmpeg-cvslog] j2kdec: merge length==0 check from jpeg2000
Michael Niedermayer
git at videolan.org
Fri May 31 03:11:45 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May 30 21:01:34 2013 +0200| [a5203d86b36e33af6424df0f0054d4ddad9a3c4f] | committer: Michael Niedermayer
j2kdec: merge length==0 check from jpeg2000
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5203d86b36e33af6424df0f0054d4ddad9a3c4f
---
libavcodec/j2kdec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c
index 94341e1..7409525 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));
More information about the ffmpeg-cvslog
mailing list