[XviD-devel] DirectShow filter crashes with DX PlayWnd sample?

Giovanni Bajo giovannibajo at libero.it
Mon Oct 13 18:31:26 CEST 2003


On Sunday, October 12, 2003 10:02 PM [GMT+1=CET],
Giovanni Bajo <giovannibajo at libero.it> wrote:

> I'm trying to play a XVID file through the PlayWnd DirectShow samples
> that comes with DirectX 8.1. I'm using the following:

Replying to myself since I got further, I managed to recompile everything in
debug and trace my problem.

I get a segfault inside yv12_to_bgra_c (or _mmx, it doesn't really matter). The
problem is that the deststride is 2536, which is less than 640*4 (the movie is
640x480). Backtracing this problem, I found out that it originates in
CXvidDecoder.cpp. This is what happens:

- CXvidDecoder::ChangeColorspace gets a FORMAT_VideoInfo. The header reports a
frame whose size is 634x455, 32bit. The stride is calculated as 635x4 = 2536.
- CXvidDecoder::Transform detects a discontinuity in the input stream (and the
flag XVID_DEC_DISCONTINUITY gets set).
- m_xvid_decore is called, but an important piece of information is lost: the
frame is not 640x480 (which is the decoder size), but only 634x455. This
difference causes yv12_to_bgra to access invalid memory, and here comes the
segfault.

Now, any idea why this happens? How am I suppose to fix/workaround this? I would
especially interested in understanding why XVID_DEC_DISCONTINUITY is set. Is
this normal?

Thanks in advance
Giovanni Bajo




More information about the XviD-devel mailing list