AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO

[BUG] reading .mp4 files results in crash

Open
#2,688 18 comments 0 reactions 0 assignees View on GitHub
bug file formats
Dominant language
C++
Stars
2.4k
Forks
698
Avg merge
3d 9h
Merged PRs (30d)
48

Description

**Describe the bug**
So, i don't really know what happens. If I'm executing the oiiotool to just read an video file (mp4), it creates the temporary destination file and then exits without any error. I can play the video via ffplay without problems.

If I'm running oiio with in my own program, it will open the video file and read the metainfo like size etc. But as soon as I call the read_image function, it will crash without an error like the oiiotool. While debugging, i've noticed that it will crash at the function FFmpegInput::read_native_callback. The debugger stops at the line of the return. So I guess that it will be some problem at the memcpy call.

Unfortunately I'll get no error or some other crash report. Just the exit of the whole program.

**To Reproduce**
Build with vcpkg with `openimageio[ffmpeg,tools]`

**Expected behavior**
I would expect, that the video file would be read into the data array

**Platform information:**
- build with vcpkg and
- OIIO branch/version: 2.1.18.1 (also with vcpkg current version 2.1.16.0)
- OS: Windows 10.0.19041 x64
- C++ compiler: MSCV v16.7.1
- Any non-default build flags when you build OIIO: no

Contributor guide

Open the contributing guide

Research direction

Start with FFmpegInput::read_native_callback, where the debugger stops during read_image, and reproduce the failure using oiiotool with an .mp4 built through vcpkg's ffmpeg and tools features. Compare the behavior with the reported metadata read and inspect the return path around the suspected memcpy. Done means reading the video into the data array completes without a crash or silent exit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.