.mov and .png open crash
- Dominant language
- C++
- Stars
- 262
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
When I was cross-compiling and using this library, I found that reading XMP metadata from .mov and .png files could cause crashes. Therefore, I added the following code between lines 70 and 71 in ISOBaseMedia_Support.cpp:
```
#if defined(_MSC_VER)
_ReadWriteBarrier();
#elif defined(__GNUC__) || defined(__clang__)
asm volatile("" ::: "memory");
#endif
```
And added the following code before line 232 in PNG_Support.cpp:
```
if (tempBuffer + 8 > bufferLimit) {
break;
}
```
Do you approve of my changes?
I look forward to your response. Thank you.
Contributor guide
Research direction
Start with ISOBaseMedia_Support.cpp around lines 70-71 and PNG_Support.cpp before line 232, then reproduce XMP reads for .mov and .png in the reported cross-compilation setup. Review whether the proposed memory barriers and buffer-limit check prevent the crashes without introducing platform-specific issues; done means both file types can be read without crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100