[FFmpeg-cvslog] h264: move 444 border xchg under if (deblock_top)

Michael Niedermayer git at videolan.org
Tue Jul 2 03:28:01 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul  2 01:41:19 2013 +0200| [f27b22b4974c740f4c7b4140a793cac196179266] | committer: Michael Niedermayer

h264: move 444 border xchg under if (deblock_top)

Fixes out of array access
Fixes Ticket2668

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f27b22b4974c740f4c7b4140a793cac196179266
---

 libavcodec/h264.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index edd34ae..c436fdb 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2230,7 +2230,6 @@ static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y,
             XCHG(h->top_borders[top_idx][h->mb_x + 1],
                  src_y + (17 << pixel_shift), 1);
         }
-    }
     if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
         if (chroma444) {
             if (deblock_topleft) {
@@ -2246,16 +2245,15 @@ static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y,
                 XCHG(h->top_borders[top_idx][h->mb_x + 1] + (32 << pixel_shift), src_cr + (17 << pixel_shift), 1);
             }
         } else {
-            if (deblock_top) {
                 if (deblock_topleft) {
                     XCHG(top_border_m1 + (16 << pixel_shift), src_cb - (7 << pixel_shift), 1);
                     XCHG(top_border_m1 + (24 << pixel_shift), src_cr - (7 << pixel_shift), 1);
                 }
                 XCHG(top_border + (16 << pixel_shift), src_cb + 1 + pixel_shift, 1);
                 XCHG(top_border + (24 << pixel_shift), src_cr + 1 + pixel_shift, 1);
-            }
         }
     }
+    }
 }
 
 static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth,



More information about the ffmpeg-cvslog mailing list