#190 access violation at specific video frame

v2.5x
closed-fixed
Internals (76)
5
2008-07-11
2008-04-17
No

While trying to encode a lengthy segmented video into H.264 using the x264 CLI, I noticed that from a specific frame on, the encoded video contained only the "CAVIStreamSynth: System exception - Access Violation at 0x0, reading from 0x0" message. I managed to reproduce the problem with a minimal 2-frame AVI file (3 MB):

http://www.quyo.de/~mfie/foo/avisynth_crash.avi

This input AVI file is OK, but when using it in AviSynth 2.5.7 with

AVISource("avisynth_crash.avi")

it crashes after the second frame. When trying to navigate to the second frame in VirtualDub 1.7 or 1.8, the last thing I see is "Avisynth read error: CAVIStreamSynth: Sys?" in the status bar, where '?' is some random character. After that, VirtualDub crashes when I try to navigate further (in VideoSourceAVI::_isKey()) or close the program (in VideoSourceAVI::_destruct()).

The problem has been observed on two different machines that have nothing in common except Windows XP Professional SP2 and HuffYUV 2.1.1. I tried both AviSynth 2.5.7 and 2.5.8-alpha (070919). I also uninstalled AviSynth 2.5.7, removed its directory completely (thus wiping all plugins) and cleanly reinstalled the 2.5.8 alpha version (070919); however, the problem remained. Only when I cut the problematic frame from the source video, it seems to work again.

Discussion

  • Ian Brabham

    Ian Brabham - 2008-07-11

    Logged In: YES
    user_id=673887
    Originator: NO

    Okay it's a HuffYUV bug, the decoder reads past the end of the input buffer by a small amount. See huffyuv_a.asm, Line 632, in the HUFF_DECOMPRESS macro.

    I will include a workaround in 2.5.8-RC3 to add some guard space to the end of the file read buffer inside AviSource.

    I could not actually get an Avisynth to crash, but I found an old VDub that did. So then I could debug the problem and see it read past the end of the input buffer.

    You should follow up this bug with the people supporting HuffYUV on Forum.Doom9.org because potentially any program reading your file might crash and this patch will only protect use with AviSource.

     
  • Ian Brabham

    Ian Brabham - 2008-07-11
    • labels: --> Internals
    • assigned_to: nobody --> ianb1957
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks