In filters/reframe_latm.c in GPAC 1.0.1 there is a Null Pointer Dereference, when gf_filter_pck_get_data is called. The first arg pck may be null with a crafted mp4 file,which results in a crash.
cpe:2.3:a:gpac:gpac:1.0.1:*:*:*:*:*:*:*
82DD2D40-0A05-48FD-940D-32B4D8B51AB3
OR
In filters/reframe_latm.c:480. There is a Null Pointer Dereference, when call `gf_filter_pck_get_data`.
The first arg pck may be null with a crafted mp4 file.

As below code shows:
`

	if (!pck) {
		if (gf_filter_pid_is_eos(ctx->ipid)) {  // check1
			if (!ctx->latm_buffer_size) {     // check2
				if (ctx->opid)
					gf_filter_pid_set_eos(ctx->opid);
				if (ctx->src_pck) gf_filter_pck_unref(ctx->src_pck);
				ctx->src_pck = NULL;
				return GF_EOS;
			}
		} else {
			return GF_OK;
		}
	}

`
Although there are checks to test if pck is null. But when check1 is true and check2 is false, the checks are nothing.
The command line:
![bug7_cmd](https://user-images.githubusercontent.com/44844446/113409005-f9563300-93e2-11eb-92aa-11491b2bb339.png)
In gdb:
![bug7](https://user-images.githubusercontent.com/44844446/113409007-fb1ff680-93e2-11eb-85c2-08fe0c6f3c29.png)

The crafted file:
[bug1.zip](https://github.com/gpac/gpac/files/6249122/bug1.zip)


A Null Pointer Dereference In function gf_filter_pck_get_data
This is a GitHub Issue
repo:gpac
owner:gpac
Title : A Null Pointer Dereference In function gf_filter_pck_get_data
Issue date:

--- start body ---
In filters/reframe_latm.c:480. There is a Null Pointer Dereference, when call `gf_filter_pck_get_data`.
The first arg pck may be null with a crafted mp4 file.

As below code shows:
`

	if (!pck) {
		if (gf_filter_pid_is_eos(ctx->ipid)) {  // check1
			if (!ctx->latm_buffer_size) {     // check2
				if (ctx->opid)
					gf_filter_pid_set_eos(ctx->opid);
				if (ctx->src_pck) gf_filter_pck_unref(ctx->src_pck);
				ctx->src_pck = NULL;
				return GF_EOS;
			}
		} else {
			return GF_OK;
		}
	}

`
Although there are checks to test if pck is null. But when check1 is true and check2 is false, the checks are nothing.
The command line:
![bug7_cmd](https://user-images.githubusercontent.com/44844446/113409005-f9563300-93e2-11eb-92aa-11491b2bb339.png)
In gdb:
![bug7](https://user-images.githubusercontent.com/44844446/113409007-fb1ff680-93e2-11eb-85c2-08fe0c6f3c29.png)

The crafted file:
[bug1.zip](https://github.com/gpac/gpac/files/6249122/bug1.zip)


--- end body ---

comments :
--- start comments ---

--- end comments ---