[libav-bugs] [Bug 396] New: H264 SPS decoding non-conformant to standard

bugzilla-daemon at aruru.libav.org bugzilla-daemon at aruru.libav.org
Sun Nov 18 13:30:20 CET 2012


https://bugzilla.libav.org/show_bug.cgi?id=396

           Summary: H264 SPS decoding non-conformant to standard
           Product: Libav
           Version: git HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: libavcodec
        AssignedTo: bugzilla at libav.org
        ReportedBy: gallandae at gmail.com


Created attachment 369
  --> https://bugzilla.libav.org/attachment.cgi?id=369
Patch conformat to H.264 spec

There is a bug in libavcodec/h264_ps.c on line 333 where it says:
    if(sps->profile_idc >= 100){ //high profile

This "if" is non-conformant to the H.264 specification (ITU-T H.264 (03/2010)
Section "7.3.2.1.1 Sequence parameter set data syntax") where the condition is
stated to be:

    if(sps->profile_idc == 100 || sps->profile_idc == 110 || sps->profile_idc
== 122 || sps->profile_idc == 244 || sps->profile_idc == 44 || sps->profile_idc
== 83 || sps->profile_idc == 86 || sps->profile_idc == 118 || sps->profile_idc
== 128){ 

As can be seen, for the specific case of profile_idc==44 (CAVLC 4:4:4 Intra
Profile) the current "if" is not entered, which causes, for starters:
the chroma_format_idc bits to be incorrectly interpreted as part of
sps->log2_max_frame_num and the same for the rest of bits which should have
been parsed within the previous "if".

This accumulation of misinterpretations usually end up producing the following,
misguiding, error message from line 396:
"This stream was generated by a broken encoder, invalid 8x8 inference"

Attached is a patch with the spec.'s "if" condition.
Should this be applied to ffmpeg source too?

-- 
Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list