• Janne Grunau's avatar
    h2645_parse: handle embedded Annex B NAL units in size prefixed NAL units · 17c99b61
    Janne Grunau authored
    Fixes a regression in ca2f19b9 with some mov/mp4 files. The files have
    several NAL units in the supposed single NAL unit after the size field.
    Annex B start code prefixes are used to separate them. The first NAL unit
    is correctly parsed but the buffer does not point to the next size field.
    Instead semi random data (it seems to be the rbsp_stop_one_bit and the
    start code prefix) is then parsed as length and will exceed the
    remaining length of the buffer.
    
    Patch based on the code in h264's decode_nal_units() and a similar
    patch by Hendrik Leppkes in FFmpeg (a9bb4cf8).
    
    Bug-Id: ffmpeg/trac5529
    Reported-By: Vittorio Giovara
    17c99b61
h2645_parse.c 9.49 KB