Skip to content

Commit 8a4dd72

Browse files
authored
Merge branch 'gpac:master' into dolby_vision
2 parents f3fcf0f + f4158e4 commit 8a4dd72

File tree

18 files changed

+233
-159
lines changed

18 files changed

+233
-159
lines changed

share/mcp/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

share/rmtws/jsrmt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function JSClient(id, client) {
228228

229229

230230

231-
return 5000;
231+
return 1000;
232232
});
233233

234234

src/filter_core/filter_register.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,13 @@ REG_DEC(ghidmx)
195195
REG_DEC(evgs)
196196
REG_DEC(ccdec)
197197
REG_DEC(ccenc)
198-
REG_DEC(scte35dec)
199198
REG_DEC(mpeghdec)
200199
REG_DEC(seiload)
201200

201+
#ifndef GPAC_DISABLE_ISOM
202+
REG_DEC(scte35dec)
203+
#endif
204+
202205
typedef const GF_FilterRegister *(*filter_reg_fun)(GF_FilterSession *session);
203206

204207
typedef struct
@@ -360,7 +363,9 @@ BuiltinReg BuiltinFilters [] = {
360363
REG_IT(evgs),
361364
REG_IT(ccdec),
362365
REG_IT(ccenc),
366+
#ifndef GPAC_DISABLE_ISOM
363367
REG_IT(scte35dec),
368+
#endif
364369
REG_IT(seiload),
365370

366371
#if !defined(GPAC_CONFIG_IOS) && !defined(GPAC_CONFIG_ANDROID)

src/filter_core/filter_session.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,9 @@ void gf_fs_del(GF_FilterSession *fsess)
834834
#endif
835835
if (fsess->prop_maps_entry_reservoir)
836836
gf_fq_del(fsess->prop_maps_entry_reservoir, gf_void_del);
837-
if (fsess->prop_maps_entry_data_alloc_reservoir)
837+
if (fsess->prop_maps_entry_data_alloc_reservoir) {
838838
gf_fq_del(fsess->prop_maps_entry_data_alloc_reservoir, gf_propalloc_del);
839+
}
839840
if (fsess->pcks_refprops_reservoir)
840841
gf_fq_del(fsess->pcks_refprops_reservoir, gf_void_del);
841842

src/filter_core/filter_session_js.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,8 +959,9 @@ static void get_filter_args(JSContext *ctx, GF_FilterSession *fs, const GF_Filt
959959
JS_SetPropertyStr(ctx, aval, "value", jsf_NewProp(ctx, &p) );
960960
} else {
961961
if (arg->arg_default_val) {
962-
gf_props_parse_value(arg->arg_type, arg->arg_name, arg->arg_default_val, arg->min_max_enum, f_inst->session->sep_list);
962+
p = gf_props_parse_value(arg->arg_type, arg->arg_name, arg->arg_default_val, arg->min_max_enum, f_inst->session->sep_list);
963963
JS_SetPropertyStr(ctx, aval, "value", jsf_NewProp(ctx, &p) );
964+
gf_props_reset_single(&p);
964965
} else {
965966
JS_SetPropertyStr(ctx, aval, "value", JS_NULL);
966967
}

src/filters/dec_scte35.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
#include <gpac/filters.h>
2727
#include <gpac/internal/isomedia_dev.h>
2828

29+
30+
#ifndef GPAC_DISABLE_ISOM
31+
32+
2933
#define IS_SEGMENTED (ctx->sampdur.den && ctx->sampdur.num>0)
3034
#define IS_PASSTHRU (ctx->mode == 1)
3135

@@ -937,3 +941,6 @@ const GF_FilterRegister *scte35dec_register(GF_FilterSession *session)
937941
{
938942
return &SCTE35DecRegister;
939943
}
944+
945+
946+
#endif /* GPAC_DISABLE_ISOM */

src/filters/dec_uncv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,8 @@ static GF_Err uncv_config(UNCVDecCtx *ctx, u8 *dsi, u32 dsi_size)
845845

846846
ctx->stride = ctx->bpp * ctx->width;
847847
ctx->output_size = ctx->stride * ctx->height;
848-
ctx->tile_width = ctx->width / config->num_tile_cols;
849-
ctx->tile_height = ctx->height / config->num_tile_rows;
848+
ctx->tile_width = config->num_tile_cols ? ctx->width / config->num_tile_cols : 0;
849+
ctx->tile_height = config->num_tile_rows ? ctx->height / config->num_tile_rows : 0;
850850
ctx->blocksize_bits = config->block_size * 8;
851851

852852
if (config->interleave==INTERLEAVE_COMPONENT) {

src/filters/dmx_nhml.c

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ static void nhmldmx_set_props(GF_NHMLDmxCtx *ctx, GF_XMLNode *props, GF_FilterPa
340340
} else {
341341
prop_type = GF_PROP_STRING;
342342
}
343+
if (prop_type == GF_PROP_STRING_LIST) {
344+
reset = GF_FALSE;
345+
}
343346
GF_PropertyValue prop_val;
344347
if (has_bs) {
345348
GF_BitStream *bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE);
@@ -357,16 +360,18 @@ static void nhmldmx_set_props(GF_NHMLDmxCtx *ctx, GF_XMLNode *props, GF_FilterPa
357360
if (p4cc) {
358361
if (pck)
359362
gf_filter_pck_set_property(pck, p4cc, &prop_val );
360-
else
363+
else {
361364
gf_filter_pid_set_property(ctx->opid, p4cc, &prop_val );
365+
}
362366
} else {
363367
if (pck)
364368
gf_filter_pck_set_property_dyn(pck, pname, &prop_val );
365369
else
366370
gf_filter_pid_set_property_dyn(ctx->opid, pname, &prop_val );
367371
}
368-
if (reset)
372+
if (reset) {
369373
gf_props_reset_single(&prop_val);
374+
}
370375
}
371376
}
372377

@@ -842,7 +847,7 @@ static GF_Err nhmldmx_config_output(GF_Filter *filter, GF_NHMLDmxCtx *ctx, GF_XM
842847
if (init_name) gf_free(init_name);
843848
return e;
844849
}
845-
} else if (ctx->header_end) {
850+
} else if (ctx->header_end && ctx->header_end < GF_UINT_MAX) {
846851
/* for text based streams, the decoder specific info can be at the beginning of the file */
847852
specInfoSize = ctx->header_end;
848853
specInfo = (char*)gf_malloc(sizeof(char) * (specInfoSize+1));
@@ -859,11 +864,12 @@ static GF_Err nhmldmx_config_output(GF_Filter *filter, GF_NHMLDmxCtx *ctx, GF_XM
859864
if (init_name) gf_free(init_name);
860865
return e;
861866
}
862-
863-
specInfo = (char*)gf_malloc(sizeof(char) * (ctx->samp_buffer_size +1));
864-
memcpy(specInfo, ctx->samp_buffer, ctx->samp_buffer_size);
865-
specInfoSize = ctx->samp_buffer_size;
866-
specInfo[specInfoSize] = 0;
867+
if (ctx->samp_buffer && ctx->samp_buffer_size < GF_UINT_MAX) {
868+
specInfo = (char*)gf_malloc(sizeof(char) * (ctx->samp_buffer_size +1));
869+
memcpy(specInfo, ctx->samp_buffer, ctx->samp_buffer_size);
870+
specInfoSize = ctx->samp_buffer_size;
871+
specInfo[specInfoSize] = 0;
872+
}
867873
}
868874

869875
i = 0;
@@ -873,6 +879,11 @@ static GF_Err nhmldmx_config_output(GF_Filter *filter, GF_NHMLDmxCtx *ctx, GF_XM
873879
if (!stricmp(node->name, ctx->is_dims ? "DIMSUnit" : "NHNTSample") ) break;
874880
if (stricmp(node->name, "DecoderSpecificInfo") ) continue;
875881

882+
if (specInfo) {
883+
gf_free(specInfo);
884+
specInfo = NULL;
885+
specInfoSize = 0;
886+
}
876887
e = gf_xml_parse_bit_sequence(node, ctx->src_url, &specInfo, &specInfoSize);
877888
if (e) {
878889
if (specInfo) gf_free(specInfo);
@@ -1511,6 +1522,11 @@ static GF_Err nhmldmx_send_sample(GF_Filter *filter, GF_NHMLDmxCtx *ctx)
15111522

15121523
char *content = gf_xml_dom_serialize(node, GF_TRUE, GF_FALSE);
15131524

1525+
if (!content) {
1526+
GF_LOG(GF_LOG_ERROR, GF_LOG_PARSER, ("[NHMLDmx] import failure in sample %d: unable to serialize node\n", ctx->sample_num));
1527+
return GF_NON_COMPLIANT_BITSTREAM;
1528+
}
1529+
15141530
ctx->samp_buffer_size = 3 + (u32) strlen(content);
15151531
if (ctx->samp_buffer_alloc < ctx->samp_buffer_size+1) {
15161532
ctx->samp_buffer_alloc = ctx->samp_buffer_size+1;

src/filters/jsfilter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,9 @@ JSValue jsf_NewProp(JSContext *ctx, const GF_PropertyValue *new_val)
644644

645645
default:
646646
if (gf_props_type_is_enum(new_val->type)) {
647-
return JS_NewString(ctx, gf_props_enum_name(new_val->type, new_val->value.uint));
647+
const char* enum_name = gf_props_enum_name(new_val->type, new_val->value.uint);
648+
if (enum_name)
649+
return JS_NewString(ctx, enum_name);
648650
}
649651
return JS_NULL;
650652
}

src/filters/load_svg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static GF_Err svgin_process(GF_Filter *filter)
205205
size = gf_bs_read_u32(bs);
206206
nb_bytes = 6;
207207
}
208-
if (pos+nb_bytes+size >= pck_size) {
208+
if (pos+nb_bytes+size > pck_size) {
209209
e = GF_NON_COMPLIANT_BITSTREAM;
210210
break;
211211
}

0 commit comments

Comments
 (0)