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

Chapter titles can be encoded in UTF-16 #13

Open
DesweR opened this issue Nov 24, 2016 · 0 comments
Open

Chapter titles can be encoded in UTF-16 #13

DesweR opened this issue Nov 24, 2016 · 0 comments

Comments

@DesweR
Copy link

DesweR commented Nov 24, 2016

src/mp4file.cpp

MP4ChapterType MP4File::GetChapters(MP4Chapter_t ** chapterList, uint32_t * chapterCount, MP4ChapterType fromChapterType)
{
...
    const char * title = (const char *)&(sample[2]);
    // collection of characters can be encoded in UTF-16

    int titleLen = min((uint32_t)((sample[0] << 8) | sample[1]), (uint32_t)MP4V2_CHAPTER_TITLE_MAX);

    // either byte in title may be zero
    strncpy(chapters[i].title, title, titleLen);

    chapters[i].title[titleLen] = 0;
...
}
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

No branches or pull requests

1 participant