• Martin Storsjö's avatar
    mov: Fix handling of zero-length metadata values · 6f4364ab
    Martin Storsjö authored
    Since 3cec81f4, a zero-length metadata value would try to
    allocate 2*0 bytes, where av_malloc() returns NULL.
    
    Always add one to the allocated length, to allow space for
    a null terminator in the zero-length case.
    
    Incidentally, this fixes fate-alac on RVCT 4.0, where a compiler
    bug seems to mess up the mov muxer to the point that it writes
    the wrong sort of metadata. Previously this bug was undetected,
    but since 3cec81f4 such mov files started returning
    AVERROR(ENOMEM) in the mov demuxer.
    Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
    6f4364ab
mov.c 115 KB