• Anton Khirnov's avatar
    mpeg12dec: move setting first_field to mpeg_field_start() · c2fa6bb0
    Anton Khirnov authored
    For field picture, the first_field is set based on its previous value.
    Before this commit, first_field is set when reading the picture
    coding extension. However, in corrupted files there may be multiple
    picture coding extension headers, so the final value of first_field that
    is actually used during decoding can be wrong. That can lead to various
    undefined behaviour, like predicting from a non-existing field.
    
    Fix this problem, by setting first_field in mpeg_field_start(), which
    should be called exactly once per field.
    
    CC: libav-stable@libav.org
    Bug-ID: 999
    c2fa6bb0
mpeg12dec.c 96.5 KB