[FFmpeg-cvslog] avcodec/jpeg2000dec: Limit poc end fields to whats available in jpeg2000_decode_packets()
Michael Niedermayer
git at videolan.org
Sat Jun 27 12:06:07 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun 27 11:48:42 2015 +0200| [8672c0a6436c9fc9d107617cf28cafe09ad3d9a5] | committer: Michael Niedermayer
avcodec/jpeg2000dec: Limit poc end fields to whats available in jpeg2000_decode_packets()
Fixes: Ticket4677
Solution based on information from
https://code.google.com/p/openjpeg/issues/detail?id=80
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8672c0a6436c9fc9d107617cf28cafe09ad3d9a5
---
libavcodec/jpeg2000dec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index fdacf57..68dd4c0 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1309,7 +1309,9 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
Jpeg2000POCEntry *e = &tile->poc.poc[i];
ret = jpeg2000_decode_packets_po_iteration(s, tile,
e->RSpoc, e->CSpoc,
- e->LYEpoc, e->REpoc, e->CEpoc,
+ FFMIN(e->LYEpoc, tile->codsty[0].nlayers),
+ e->REpoc,
+ FFMIN(e->CEpoc, s->ncomponents),
e->Ppoc, &tp_index
);
if (ret < 0)
More information about the ffmpeg-cvslog
mailing list