mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
typefind: Fix out-of-bound read in PNM typefinder
This commit is contained in:
parent
24a5a03d27
commit
a23d4d1c1f
1 changed files with 11 additions and 2 deletions
|
@ -4148,15 +4148,24 @@ pnm_type_find (GstTypeFind * tf, gpointer ununsed)
|
|||
|
||||
/* need to skip any comment lines first */
|
||||
data_scan_ctx_advance (tf, &c, 3);
|
||||
|
||||
if (!data_scan_ctx_ensure_data (tf, &c, 1))
|
||||
return;
|
||||
|
||||
while (c.data[0] == '#') { /* we know there's still data left */
|
||||
data_scan_ctx_advance (tf, &c, 1);
|
||||
while (c.data[0] != '\n' && c.data[0] != '\r') {
|
||||
if (!data_scan_ctx_ensure_data (tf, &c, 4))
|
||||
if (!data_scan_ctx_ensure_data (tf, &c, 1))
|
||||
return;
|
||||
|
||||
while (c.data[0] != '\n' && c.data[0] != '\r') {
|
||||
data_scan_ctx_advance (tf, &c, 1);
|
||||
if (!data_scan_ctx_ensure_data (tf, &c, 1))
|
||||
return;
|
||||
}
|
||||
data_scan_ctx_advance (tf, &c, 1);
|
||||
GST_LOG ("skipped comment line in PNM header");
|
||||
if (!data_scan_ctx_ensure_data (tf, &c, 1))
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data_scan_ctx_ensure_data (tf, &c, 32) &&
|
||||
|
|
Loading…
Reference in a new issue