Browse Source

avcodec/h264_cavlc: Set valid qscale value in ff_h264_decode_mb_cavlc()

When ff_h264_decode_mb_cavlc() failed due to wrong sl->qscale values,
e.g. dquant out of range, set the qscale to be a valid value before
returning -1 and exiting the function. The qscale value can be used
later e.g. in loop filter.

BUG=806122

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 71f39de2a5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.7
Xiaohan Wang Michael Niedermayer 7 years ago
parent
commit
e8fb74c0c9
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/h264_cavlc.c

+ 1
- 0
libavcodec/h264_cavlc.c View File

@@ -1111,6 +1111,7 @@ decode_intra_mb:
else sl->qscale -= max_qp+1; else sl->qscale -= max_qp+1;
if (((unsigned)sl->qscale) > max_qp){ if (((unsigned)sl->qscale) > max_qp){
av_log(h->avctx, AV_LOG_ERROR, "dquant out of range (%d) at %d %d\n", dquant, sl->mb_x, sl->mb_y); av_log(h->avctx, AV_LOG_ERROR, "dquant out of range (%d) at %d %d\n", dquant, sl->mb_x, sl->mb_y);
sl->qscale = max_qp;
return -1; return -1;
} }
} }


Loading…
Cancel
Save