Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 29a78cc

Browse files
authored
Merge pull request #111 from bbc/philipn-release-v1.4
Release v1.4 updates
2 parents b74e2ba + 005e74f commit 29a78cc

File tree

9 files changed

+64
-30
lines changed

9 files changed

+64
-30
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# bmx Changelog
22

3+
## v1.4
4+
5+
### Breaking changes
6+
7+
* None
8+
9+
### Features
10+
11+
* Add support for the ARD ZDF XDF Multi Essence Location Style profile (https://github.com/bbc/bmx/pull/105)
12+
* Detect more platform and architectures for the MXF Identification platform string (https://github.com/bbc/bmx/pull/84)
13+
* Improve compliance of RDD 9 partition durations and sizes (https://github.com/bbc/bmx/pull/12)
14+
15+
### Bug fixes
16+
17+
* Fix a missing file execute permission on the libMXF run test file script (https://github.com/bbc/bmx/pull/109)
18+
19+
### Build changes
20+
21+
* None
22+
323
## v1.3
424

525
### Breaking changes

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else()
1313
endif()
1414

1515
project(bmx
16-
VERSION 1.3
16+
VERSION 1.4
1717
DESCRIPTION "A C++ library and set of utilities to read and write the SMPTE ST 377-1 MXF file format"
1818
HOMEPAGE_URL https://github.com/bbc/bmx
1919
LANGUAGES C CXX

deps/libMXF/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else()
1313
endif()
1414

1515
project(libMXF
16-
VERSION 1.3
16+
VERSION 1.4
1717
DESCRIPTION "Low-level C library for reading and writing the SMPTE ST 377-1 MXF file format"
1818
HOMEPAGE_URL https://github.com/bbc/libMXF
1919
LANGUAGES C CXX

deps/libMXF/examples/archive/write/write_archive_mxf.c

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#define MIN_LLEN 4
6969
#define ESS_ELEMENT_LLEN 4
7070

71+
#define LIMIT_UINT32(val) ((val) > UINT32_MAX ? UINT32_MAX : (uint32_t)(val))
7172

7273

7374
typedef struct
@@ -1427,13 +1428,14 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
14271428
int i;
14281429
int64_t filePos;
14291430
long j;
1431+
uint32_t k;
14301432
MXFListIterator iter;
14311433
const PSEFailure *pseFailure;
14321434
const VTRError *vtrError;
14331435
const DigiBetaDropout *digiBetaDropout;
14341436
const TimecodeBreak *timecodeBreak;
14351437
uint32_t nextTrackID;
1436-
int numTracks;
1438+
uint32_t numTracks;
14371439
TimecodeIndexSearcher vitcIndexSearcher;
14381440
TimecodeIndexSearcher ltcIndexSearcher;
14391441
int64_t errorPosition;
@@ -1454,10 +1456,10 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
14541456

14551457
/* update the PSE failure and VTR error counts */
14561458

1457-
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_VTRErrorCount), numVTRErrors));
1458-
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_PSEFailureCount), numPSEFailures));
1459-
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_DigiBetaDropoutCount), numDigiBetaDropouts));
1460-
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_TimecodeBreakCount), numTimecodeBreaks));
1459+
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_VTRErrorCount), LIMIT_UINT32(numVTRErrors)));
1460+
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_PSEFailureCount), LIMIT_UINT32(numPSEFailures)));
1461+
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_DigiBetaDropoutCount), LIMIT_UINT32(numDigiBetaDropouts)));
1462+
CHK_ORET(mxf_set_uint32_item(output->prefaceSet, &MXF_ITEM_K(Preface, APP_TimecodeBreakCount), LIMIT_UINT32(numTimecodeBreaks)));
14611463

14621464

14631465
/* update the header metadata durations and audio sequence offset */
@@ -1545,8 +1547,8 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
15451547
{
15461548
/* if num PSE failures exceeds MAX_STRONG_REF_ARRAY_COUNT then the failures are
15471549
written in > 1 tracks */
1548-
numTracks = (numPSEFailures + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT;
1549-
for (i = 0; i < numTracks; i++)
1550+
numTracks = LIMIT_UINT32((numPSEFailures + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT);
1551+
for (k = 0; k < numTracks; k++)
15501552
{
15511553
/* Preface - ContentStorage - SourcePackage - DM Event Track */
15521554
CHK_ORET(mxf_create_set(output->headerMetadata, &MXF_SET_K(EventTrack), &output->sourcePackageTrackSet));
@@ -1628,8 +1630,8 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
16281630
{
16291631
/* if numVTRErrorsLocated exceeds MAX_STRONG_REF_ARRAY_COUNT then the errors are
16301632
written in > 1 tracks */
1631-
numTracks = (numVTRErrorsLocated + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT;
1632-
for (j = 0; j < numTracks; j++)
1633+
numTracks = LIMIT_UINT32((numVTRErrorsLocated + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT);
1634+
for (k = 0; k < numTracks; k++)
16331635
{
16341636
/* Preface - ContentStorage - SourcePackage - DM Event Track */
16351637
CHK_ORET(mxf_create_set(output->headerMetadata, &MXF_SET_K(EventTrack), &output->sourcePackageTrackSet));
@@ -1656,8 +1658,8 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
16561658
{
16571659
/* if num dropouts exceeds MAX_STRONG_REF_ARRAY_COUNT then the failures are
16581660
written in > 1 tracks */
1659-
numTracks = (numDigiBetaDropouts + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT;
1660-
for (i = 0; i < numTracks; i++)
1661+
numTracks = LIMIT_UINT32((numDigiBetaDropouts + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT);
1662+
for (k = 0; k < numTracks; k++)
16611663
{
16621664
/* Preface - ContentStorage - SourcePackage - DM Event Track */
16631665
CHK_ORET(mxf_create_set(output->headerMetadata, &MXF_SET_K(EventTrack), &output->sourcePackageTrackSet));
@@ -1681,8 +1683,8 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
16811683
{
16821684
/* if num breaks exceeds MAX_STRONG_REF_ARRAY_COUNT then the failures are
16831685
written in > 1 tracks */
1684-
numTracks = (numTimecodeBreaks + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT;
1685-
for (i = 0; i < numTracks; i++)
1686+
numTracks = LIMIT_UINT32((numTimecodeBreaks + MAX_STRONG_REF_ARRAY_COUNT - 1) / MAX_STRONG_REF_ARRAY_COUNT);
1687+
for (k = 0; k < numTracks; k++)
16861688
{
16871689
/* Preface - ContentStorage - SourcePackage - DM Event Track */
16881690
CHK_ORET(mxf_create_set(output->headerMetadata, &MXF_SET_K(EventTrack), &output->sourcePackageTrackSet));
@@ -1733,7 +1735,7 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
17331735
CHK_ORET(mxf_set_strongref_item(output->sourcePackageTrackSet, &MXF_ITEM_K(GenericTrack, Sequence), output->sequenceSet));
17341736
CHK_ORET(mxf_set_ul_item(output->sequenceSet, &MXF_ITEM_K(StructuralComponent, DataDefinition), &MXF_DDEF_L(DescriptiveMetadata)));
17351737

1736-
for (j = 0; j < MAX_STRONG_REF_ARRAY_COUNT && timecodeBreakIndex < numTimecodeBreaks; j++, timecodeBreakIndex++)
1738+
for (k = 0; k < MAX_STRONG_REF_ARRAY_COUNT && timecodeBreakIndex < numTimecodeBreaks; k++, timecodeBreakIndex++)
17371739
{
17381740
timecodeBreak = (const TimecodeBreak*)&timecodeBreaks[timecodeBreakIndex];
17391741

@@ -1790,7 +1792,7 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
17901792
CHK_ORET(mxf_set_strongref_item(output->sourcePackageTrackSet, &MXF_ITEM_K(GenericTrack, Sequence), output->sequenceSet));
17911793
CHK_ORET(mxf_set_ul_item(output->sequenceSet, &MXF_ITEM_K(StructuralComponent, DataDefinition), &MXF_DDEF_L(DescriptiveMetadata)));
17921794

1793-
for (j = 0; j < MAX_STRONG_REF_ARRAY_COUNT && digiBetaDropoutIndex < numDigiBetaDropouts; j++, digiBetaDropoutIndex++)
1795+
for (k = 0; k < MAX_STRONG_REF_ARRAY_COUNT && digiBetaDropoutIndex < numDigiBetaDropouts; k++, digiBetaDropoutIndex++)
17941796
{
17951797
digiBetaDropout = (const DigiBetaDropout*)&digiBetaDropouts[digiBetaDropoutIndex];
17961798

@@ -1846,7 +1848,7 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
18461848
CHK_ORET(mxf_set_strongref_item(output->sourcePackageTrackSet, &MXF_ITEM_K(GenericTrack, Sequence), output->sequenceSet));
18471849
CHK_ORET(mxf_set_ul_item(output->sequenceSet, &MXF_ITEM_K(StructuralComponent, DataDefinition), &MXF_DDEF_L(DescriptiveMetadata)));
18481850

1849-
for (j = 0; j < MAX_STRONG_REF_ARRAY_COUNT && failureIndex < numPSEFailures; j++, failureIndex++)
1851+
for (k = 0; k < MAX_STRONG_REF_ARRAY_COUNT && failureIndex < numPSEFailures; k++, failureIndex++)
18501852
{
18511853
pseFailure = (const PSEFailure*)&pseFailures[failureIndex];
18521854

@@ -1910,7 +1912,7 @@ int complete_archive_mxf_file(ArchiveMXFWriter **outputRef, const InfaxData *sou
19101912
CHK_ORET(mxf_set_strongref_item(output->sourcePackageTrackSet, &MXF_ITEM_K(GenericTrack, Sequence), output->sequenceSet));
19111913
CHK_ORET(mxf_set_ul_item(output->sequenceSet, &MXF_ITEM_K(StructuralComponent, DataDefinition), &MXF_DDEF_L(DescriptiveMetadata)));
19121914

1913-
for (j = 0; j < MAX_STRONG_REF_ARRAY_COUNT && errorIndex < numVTRErrors; j++, errorIndex++)
1915+
for (k = 0; k < MAX_STRONG_REF_ARRAY_COUNT && errorIndex < numVTRErrors; k++, errorIndex++)
19141916
{
19151917
vtrError = (const VTRError*)&vtrErrors[errorIndex];
19161918

deps/libMXF/tools/MXFDump/MXFDump.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <stdlib.h>
4545
#include <string.h>
4646
#include <stdarg.h>
47+
#include <limits.h>
4748

4849
#if defined (_MSC_VER) && defined(_M_IX86) && defined(_WIN32)
4950
#define MXF_COMPILER_MSC_INTEL_WINDOWS
@@ -7179,11 +7180,11 @@ bool getInteger(int& i, char* s)
71797180
bool result;
71807181
char* expectedEnd = &s[strlen(s)];
71817182
char* end;
7182-
int b = strtoul(s, &end, 10);
7183-
if (end != expectedEnd) {
7183+
long b = strtoul(s, &end, 10);
7184+
if (end != expectedEnd || b > INT_MAX || b < INT_MIN) {
71847185
result = false;
71857186
} else {
7186-
i = b;
7187+
i = (int)b;
71877188
result = true;
71887189
}
71897190
return result;

deps/libMXFpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else()
1313
endif()
1414

1515
project(libMXF++
16-
VERSION 1.3
16+
VERSION 1.4
1717
DESCRIPTION "C++ wrapper library for libMXF that supports reading and writing the SMPTE ST 377-1 MXF file format"
1818
HOMEPAGE_URL https://github.com/bbc/libMXFpp
1919
LANGUAGES CXX

docs/release.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ This describes the steps for making a release.
1313
* Check the [runner versions](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners) (e.g. `windows-2019` and `macos-13`) in the [release.yml](../.github/workflows/release.yml) workflow file are still available
1414
* Select the oldest macOS version available to help with compatibility
1515
* Run the [Release](https://github.com/bbc/bmx/actions/workflows/release.yml) workflow in GitHub Actions using the release branch to check it succeeds
16+
* Create a temporary tag using the steps from [Create a Release Tag](#create-a-release-tag) and then delete the tag once the workflow succeeds using the following commands:
17+
18+
```bash
19+
git push --delete origin v${BMX_VERSION}
20+
git tag -d v${BMX_VERSION}
21+
```
22+
1623
* Create and merge a PR for the release branch into `main`
1724

1825
## Create a Release Tag
@@ -24,7 +31,7 @@ This describes the steps for making a release.
2431
export BMX_VERSION=<major version>.<minor version>
2532
git checkout main
2633
git pull --rebase
27-
git tag -a v${BMX_VERSION} -m "Version ${BMX_VERSION}"`
34+
git tag -a v${BMX_VERSION} -m "Version ${BMX_VERSION}"
2835
git push origin v${BMX_VERSION}
2936
```
3037

include/bmx/essence_parser/JXSEssenceParser.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ namespace bmx
5656
inline uint32_t Swap32(uint32_t i)
5757
{
5858
return
59-
((i & 0x000000ffUL) << 24) |
60-
((i & 0xff000000UL) >> 24) |
61-
((i & 0x0000ff00UL) << 8) |
62-
((i & 0x00ff0000UL) >> 8);
59+
((i & 0x000000ffU) << 24) |
60+
((i & 0xff000000U) >> 24) |
61+
((i & 0x0000ff00U) << 8) |
62+
((i & 0x00ff0000U) >> 8);
6363
}
6464

6565
struct JPEGXSPictureSubDescriptor

src/rdd9_mxf/RDD9IndexTable.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
#include "config.h"
3434
#endif
3535

36+
#define __STDC_LIMIT_MACROS
37+
38+
#include <climits>
39+
3640
#include <algorithm>
3741

3842
#include <bmx/rdd9_mxf/RDD9ContentPackage.h>
@@ -515,8 +519,8 @@ void RDD9IndexTable::WriteVBESegments(File *mxf_file, Partition *partition, vect
515519
partition->fillToKag(mxf_file);
516520
} else {
517521
int64_t current_count = mxf_file->tell() - segment_start_file_pos;
518-
if (current_count < mFirstIndexSegmentCount)
519-
partition->allocateSpaceToKag(mxf_file, mFirstIndexSegmentCount - current_count);
522+
if (current_count < mFirstIndexSegmentCount && mFirstIndexSegmentCount - current_count <= UINT32_MAX)
523+
partition->allocateSpaceToKag(mxf_file, (uint32_t)(mFirstIndexSegmentCount - current_count));
520524
else
521525
partition->fillToKag(mxf_file);
522526
}

0 commit comments

Comments
 (0)