diff options
author | Kieran Kunhya <kierank@ob-encoder.com> | 2015-12-16 23:26:03 +0000 |
---|---|---|
committer | Kieran Kunhya <kierank@ob-encoder.com> | 2015-12-16 23:26:03 +0000 |
commit | 25f6ccccd69038f80450351f69b8225df6042d68 (patch) | |
tree | e48881b05319929ff26bee8d8c69f3355dafdc8c /libavcodec/diracdec.c | |
parent | a349a10edf84982cf1cf3b8747a6a2e7ca733083 (diff) | |
download | ffmpeg-25f6ccccd69038f80450351f69b8225df6042d68.tar.gz |
diracdec: Fix codeblock parameters reading
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r-- | libavcodec/diracdec.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index abe1a5a9d7..07eb512ad9 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1128,7 +1128,22 @@ static int dirac_unpack_idwt_params(DiracContext *s) CHECKEDREAD(s->wavelet_depth, tmp > MAX_DWT_LEVELS || tmp < 1, "invalid number of DWT decompositions\n") - if (s->low_delay) { + if (!s->low_delay) { + /* Codeblock parameters (core syntax only) */ + if (get_bits1(gb)) { + for (i = 0; i <= s->wavelet_depth; i++) { + CHECKEDREAD(s->codeblock[i].width , tmp < 1 || tmp > (s->avctx->width >>s->wavelet_depth-i), "codeblock width invalid\n") + CHECKEDREAD(s->codeblock[i].height, tmp < 1 || tmp > (s->avctx->height>>s->wavelet_depth-i), "codeblock height invalid\n") + } + + CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n") + } + else { + for (i = 0; i <= s->wavelet_depth; i++) + s->codeblock[i].width = s->codeblock[i].height = 1; + } + } + else { s->num_x = svq3_get_ue_golomb(gb); s->num_y = svq3_get_ue_golomb(gb); if (s->ld_picture) { |