Skip to content

Commit

Permalink
fixed #2425
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlf committed Mar 27, 2023
1 parent 8912a05 commit e7f96c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/filters/reframe_rawpcm.c
Expand Up @@ -250,6 +250,7 @@ GF_Err pcmreframe_process(GF_Filter *filter)

if (ctx->probe_wave==1) {
Bool wav_ok = GF_TRUE;
Bool hdr_found = GF_FALSE;
GF_BitStream *bs;
if (ctx->probe_data) {
ctx->probe_data = gf_realloc(ctx->probe_data, ctx->probe_data_size+pck_size);
Expand Down Expand Up @@ -280,6 +281,7 @@ GF_Err pcmreframe_process(GF_Filter *filter)
continue;
}
//parse fmt
hdr_found = GF_TRUE;
u16 atype = gf_bs_read_u16_le(bs);
ctx->ch = gf_bs_read_u16_le(bs);
ctx->sr = gf_bs_read_u32_le(bs);
Expand Down Expand Up @@ -312,11 +314,13 @@ GF_Err pcmreframe_process(GF_Filter *filter)
memcpy(ctx->probe_data, data, pck_size);
ctx->probe_data_size = pck_size;
}
if (ctx->probe_data_size<=10000) {
gf_filter_pid_drop_packet(ctx->ipid);
return GF_OK;
if (!hdr_found) {
if (ctx->probe_data_size<=10000) {
gf_filter_pid_drop_packet(ctx->ipid);
return GF_OK;
}
GF_LOG(GF_LOG_WARNING, GF_LOG_MEDIA, ("[PCMReframe] Cannot find wave data chunk after %d bytes, aborting\n", ctx->probe_data_size));
}
GF_LOG(GF_LOG_WARNING, GF_LOG_MEDIA, ("[PCMReframe] Cannot find wave data chink afetr %d bytes, aborting\n", ctx->probe_data_size));
wav_ok = GF_FALSE;
}

Expand Down
4 changes: 4 additions & 0 deletions src/utils/bitstream.c
Expand Up @@ -1266,6 +1266,10 @@ void gf_bs_skip_bytes(GF_BitStream *bs, u64 nbBytes)
}
} else {
bs->position += nbBytes;
if (bs->position>bs->size) {
bs->position = bs->size;
bs->overflow_state = 1;
}
}
return;
}
Expand Down

0 comments on commit e7f96c2

Please sign in to comment.