#424 Crash when using IAMStreamConfig GetStreamCaps function

open
nobody
Libraries (86)
5
2012-05-15
2012-05-15
Anonymous
No

lame.ax
When the IAMStreamConfig::GetStreamCaps() is called, the filter crashes because of the unitialized variable "m_mt" if the output pin is not connected. m_mt represents the connection mediatype of the output pin, however the pin can be not connected when GetStreamCaps() is called.

Discussion

  • Joseph Flynn
    Joseph Flynn
    2012-05-15

    I am not trying to justify the crash but your methodology is incorrect. The compressor output pins need to be rendered *before* you set the compression parameters or call GetStreamCaps().

    Joe Flynn

     
  • Maxsmi
    Maxsmi
    2012-05-16

    There is no such restrictions in a documentation. Here is what the documentation says:
    "Filters implement the IAMStreamConfig::SetFormat method to set the audio or video format before the filter's pins are connected. If your output pin is already connected and you can provide a new type, then reconnect your pin..."
    The GetStreamCaps() is called before SetFormat(). That means there is no need to have a connected pin.