avcodec/jpeglsdec/ff_jpegls_decode_lse: check len field validity

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/64/head
Michael Niedermayer 11 years ago
parent 020600eed1
commit 2773ab36cc
  1. 5
      libavcodec/jpeglsdec.c

@ -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);

Loading…
Cancel
Save