Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid pointer casting in H264 packetizer #1155

Closed
ray1422 opened this issue Apr 10, 2024 · 3 comments · Fixed by #1157
Closed

Invalid pointer casting in H264 packetizer #1155

ray1422 opened this issue Apr 10, 2024 · 3 comments · Fixed by #1157

Comments

@ray1422
Copy link

ray1422 commented Apr 10, 2024

This causes runtime error when sanitizer is enabled since vector is not aligned to 4, and uint32_t requires 4 bytes alignment.

https://github.com/paullouisageneau/libdatachannel/blob/master/src/h264rtppacketizer.cpp#L36C4-L36C10

@ray1422 ray1422 changed the title Invalid pointer casting in H264 packetized Invalid pointer casting in H264 packetizer Apr 10, 2024
@ray1422
Copy link
Author

ray1422 commented Apr 10, 2024

reproduce steps

  1. Enable sanitizers
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined -fsanitize=leak")
  1. compile with g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  2. run streamer example

errors:
libdatachannel/examples/streamer/h264fileparser.cpp:32:32: runtime error: load of misaligned address 0x63200000081d for type 'unsigned int', which requires 4 byte alignment

/workspaces/libdatachannel/src/h264rtppacketizer.cpp:36:36
libdatachannel/src/h264rtppacketizer.cpp:36:36: runtime error: load of misaligned address 0x63200006081d for type 'unsigned int', which requires 4 byte alignment

@ray1422
Copy link
Author

ray1422 commented Apr 10, 2024

#1157

@paullouisageneau
Copy link
Owner

Thank you for reporting and fixing the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants