mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
yadif: Fix illegal memory access
When applying the spatial prediction, there is an illegal access of -1 index of array. Hence adding a condition to avoid this. https://bugzilla.gnome.org/show_bug.cgi?id=759518
This commit is contained in:
parent
eb7deb4418
commit
50978ccd1a
1 changed files with 7 additions and 4 deletions
|
@ -56,12 +56,15 @@
|
|||
int temporal_diff2 =(FFABS(next[mrefs] - c) + FFABS(next[prefs] - e) )>>1; \
|
||||
int diff = FFMAX3(temporal_diff0 >> 1, temporal_diff1, temporal_diff2); \
|
||||
int spatial_pred = (c+e) >> 1; \
|
||||
int spatial_score = FFABS(cur[mrefs - 1] - cur[prefs - 1]) + FFABS(c-e) \
|
||||
+ FFABS(cur[mrefs + 1] - cur[prefs + 1]) - 1; \
|
||||
int spatial_score = -1; \
|
||||
\
|
||||
CHECK(-1) CHECK(-2) }} }} \
|
||||
CHECK( 1) CHECK( 2) }} }} \
|
||||
if (mrefs > 0 && prefs > 0) { \
|
||||
spatial_score = FFABS(cur[mrefs - 1] - cur[prefs - 1]) + FFABS(c-e) \
|
||||
+ FFABS(cur[mrefs + 1] - cur[prefs + 1]) - 1; \
|
||||
\
|
||||
CHECK(-1) CHECK(-2) }} }} \
|
||||
CHECK( 1) CHECK( 2) }} }} \
|
||||
} \
|
||||
if (mode < 2) { \
|
||||
int b = (prev2[2 * mrefs] + next2[2 * mrefs])>>1; \
|
||||
int f = (prev2[2 * prefs] + next2[2 * prefs])>>1; \
|
||||
|
|
Loading…
Reference in a new issue