h265parser: prevent to overrun chroma_weight_l0_flag

The index of elements cannot exceed or equal to the size of elements.

https://bugzilla.gnome.org/show_bug.cgi?id=722101
This commit is contained in:
Justin Joy 2014-01-13 21:50:16 +09:00 committed by Sebastian Dröge
parent d1877b0b95
commit 6587e924f1

View file

@ -1173,7 +1173,7 @@ gst_h265_slice_parse_pred_weight_table (GstH265SliceHdr * slice, NalReader * nr)
READ_UE_ALLOWED (nr, p->luma_log2_weight_denom, 0, 7);
/* set default values */
for (i = 0; i <= G_N_ELEMENTS (p->chroma_weight_l0_flag); i++) {
for (i = 0; i < G_N_ELEMENTS (p->chroma_weight_l0_flag); i++) {
p->chroma_weight_l0_flag[i] = 0;
p->luma_offset_l0[i] = 0;
}