History

avcodec/vc1: fix out of bounds access of overlap filter

Overlap filtering of the first row and first column must be guarded for out of bounds access of v->over_flags_plane.

Jerome Borsboom committed 8 years ago

Commit 02e49701 parent 33021581 file · +3 −3Browse files

Unified · Split

libavcodec/vc1_loopfilter.c+3−3
@@ -110,19 +110,19 @@ void ff_vc1_i_overlap_filter(VC1Context *v) · 109 unmodified lines
110110 * we run the put_pixels loop, i.e. delayed by one row and one column. */
111111 for (i = 0; i < block_count; i++)
112112 if (v->pq >= 9 || v->condover == CONDOVER_ALL ||
113− (v->over_flags_plane[mb_pos] && ((i & 5) == 1 || v->over_flags_plane[mb_pos - 1])))
113+ (v->over_flags_plane[mb_pos] && ((i & 5) == 1 || (s->mb_x && v->over_flags_plane[mb_pos - 1]))))
114114 vc1_h_overlap_filter(v, s->mb_x ? left_blk : cur_blk, cur_blk, i);
115115
116116 if (v->fcm != ILACE_FRAME)
117117 for (i = 0; i < block_count; i++) {
118118 if (s->mb_x && (v->pq >= 9 || v->condover == CONDOVER_ALL ||
119119 (v->over_flags_plane[mb_pos - 1] &&
120− ((i & 2) || v->over_flags_plane[mb_pos - 1 - s->mb_stride]))))
120+ ((i & 2) || (!s->first_slice_line && v->over_flags_plane[mb_pos - 1 - s->mb_stride])))))
121121 vc1_v_overlap_filter(v, s->first_slice_line ? left_blk : topleft_blk, left_blk, i);
122122 if (s->mb_x == s->mb_width - 1)
123123 if (v->pq >= 9 || v->condover == CONDOVER_ALL ||
124124 (v->over_flags_plane[mb_pos] &&
125− ((i & 2) || v->over_flags_plane[mb_pos - s->mb_stride])))
125+ ((i & 2) || (!s->first_slice_line && v->over_flags_plane[mb_pos - s->mb_stride]))))
126126 vc1_v_overlap_filter(v, s->first_slice_line ? cur_blk : top_blk, cur_blk, i);
127127 }
128128 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t