diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-02-20 02:38:32 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-02-20 18:58:38 +0100 |
commit | f777504f640260337974848c7d5d7a3f064bbb45 (patch) | |
tree | dc90b315e1390f57d4dd96d45cd5b822e3ae2e3d /libavcodec/h264_loopfilter.c | |
parent | 5c79d2e12d13959fc6aed92d102c25194a06de05 (diff) | |
download | ffmpeg-streaming-f777504f640260337974848c7d5d7a3f064bbb45.zip ffmpeg-streaming-f777504f640260337974848c7d5d7a3f064bbb45.tar.gz |
h264: Lower bound check for slice offsets
And use the value from the specification.
Sample-Id: 00000451-google
Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/h264_loopfilter.c')
-rw-r--r-- | libavcodec/h264_loopfilter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c index b8bf555..88ed34c 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -252,8 +252,8 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h, int top_type= h->top_type; int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); - int a = h->slice_alpha_c0_offset - qp_bd_offset; - int b = h->slice_beta_offset - qp_bd_offset; + int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset; + int b = 52 + h->slice_beta_offset - qp_bd_offset; int mb_type = h->cur_pic.mb_type[mb_xy]; int qp = h->cur_pic.qscale_table[mb_xy]; @@ -707,8 +707,8 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint av_unused int dir; int chroma = !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY)); int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); - int a = h->slice_alpha_c0_offset - qp_bd_offset; - int b = h->slice_beta_offset - qp_bd_offset; + int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset; + int b = 52 + h->slice_beta_offset - qp_bd_offset; if (FRAME_MBAFF(h) // and current and left pair do not have the same interlaced type |