[PR #1313] [MERGED] [FIX] Fix segfault on Windows #2091

Open
opened 2026-01-29 17:20:14 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1313
Author: @pranavrajpal
Created: 4/2/2021
Status: Merged
Merged: 4/2/2021
Merged by: @cfsmp3

Base: masterHead: fix-segfault-windows


📝 Commits (2)

📊 Changes

2 files changed (+3 additions, -1 deletions)

View changed files

📝 docs/CHANGES.TXT (+1 -0)
📝 src/thirdparty/gpacmp4/gpac/internal/isomedia_dev.h (+2 -1)

📄 Description

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

Using the format specifier %d to print out size is technically undefined behavior, as size is defined as a u64, while %d is meant to print out an int (which is typically 32 bits). This causes a segfault on Windows as this apparently causes the wrong pointer to be passed in for the filename.

The segfault was caused with the file from #1223, but I don't know if it was related as I was not able to reproduce it hanging as mentioned in that issue. This also appears to be similar to #1252 as the output right before the crash is very similar to the output in https://github.com/CCExtractor/ccextractor/issues/1252#issuecomment-657259396 and the change that causes this is bbe2f33399, which is before 0.88 was released.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1313 **Author:** [@pranavrajpal](https://github.com/pranavrajpal) **Created:** 4/2/2021 **Status:** ✅ Merged **Merged:** 4/2/2021 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix-segfault-windows` --- ### 📝 Commits (2) - [`78eca44`](https://github.com/CCExtractor/ccextractor/commit/78eca444b79d11c80bb25058f6673571b759db11) Fix segfault on Windows - [`2461821`](https://github.com/CCExtractor/ccextractor/commit/24618218d26b91ebd55093ebf316d0f7d90e558e) Add change to changelog ### 📊 Changes **2 files changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/CHANGES.TXT` (+1 -0) 📝 `src/thirdparty/gpacmp4/gpac/internal/isomedia_dev.h` (+2 -1) </details> ### 📄 Description **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [x] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [x] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [ ] I am an active contributor to CCExtractor. --- Using the format specifier %d to print out size is technically undefined behavior, as size is defined as a u64, while %d is meant to print out an int (which is typically 32 bits). This causes a segfault on Windows as this apparently causes the wrong pointer to be passed in for the filename. The segfault was caused with the file from #1223, but I don't know if it was related as I was not able to reproduce it hanging as mentioned in that issue. This also appears to be similar to #1252 as the output right before the crash is very similar to the output in https://github.com/CCExtractor/ccextractor/issues/1252#issuecomment-657259396 and the change that causes this is bbe2f333997fe8d90f3851ba6dcdbd5d58e3ecf0, which is before 0.88 was released. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:20:14 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2091