• Andreas Rheinhardt's avatar
    avcodec/ffv1enc: Fix out-of-bounds-array access · f7bc0386
    Andreas Rheinhardt authored
    libavcodec/ffv1enc.c accessed an array of uint8_t [32] via array[0][j]
    in order to loop over all the uint8_t in this array of arrays. Of course
    this implied an out-of-bounds access for array[0] and UBSan complained
    about this. So replace this with nested loops; furthermore, factor this
    out into a function of its own to easily break out of the nested loops.
    
    This affected the FATE-tests vsynth1-ffv1, vsynth1-ffv1-v3-yuv420p,
    vsynth1-ffv1-v3-yuv422p10, vsynth1-ffv1-v3-yuv444p16,
    vsynth1-ffv1-v3-bgr0, vsynth1-ffv1-ffv1-v3-rgb48 as well as the
    corresponding vsynth2-*, vsynth3-* and the vsynth_lena-* tests.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    f7bc0386
ffv1enc.c 50.1 KB