avcodec/jpeglsdec/ff_jpegls_decode_lse: check len field validity

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-04-09 23:05:15 +02:00
parent 020600eed1
commit 2773ab36cc
1 changed files with 4 additions and 1 deletions

View File

@ -52,11 +52,14 @@ int ff_jpegls_decode_lse(MJpegDecodeContext *s)
int id;
int tid, wt, maxtab, i, j;
int len = get_bits(&s->gb, 16); /* length: FIXME: verify field validity */
int len = get_bits(&s->gb, 16);
id = get_bits(&s->gb, 8);
switch (id) {
case 1:
if (len < 13)
return AVERROR_INVALIDDATA;
s->maxval = get_bits(&s->gb, 16);
s->t1 = get_bits(&s->gb, 16);
s->t2 = get_bits(&s->gb, 16);