Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3f55d106
Commit
3f55d106
authored
Oct 19, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Oct 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Cope with invalid MP3 headers being detect as valid.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b1e20ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
mpegsplit.c
dlls/quartz/mpegsplit.c
+29
-4
No files found.
dlls/quartz/mpegsplit.c
View file @
3f55d106
...
...
@@ -476,7 +476,7 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin, ALLOCATO
HRESULT
hr
;
LONGLONG
pos
=
0
;
/* in bytes */
BYTE
header
[
10
];
int
streamtype
=
0
;
int
streamtype
;
LONGLONG
total
,
avail
;
AM_MEDIA_TYPE
amt
;
PIN_INFO
piOutput
;
...
...
@@ -514,12 +514,37 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin, ALLOCATO
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
,
4
,
header
);
if
(
SUCCEEDED
(
hr
))
pos
+=
4
;
TRACE
(
"%x:%x:%x:%x
\n
"
,
header
[
0
],
header
[
1
],
header
[
2
],
header
[
3
]);
}
while
(
0
);
while
(
SUCCEEDED
(
hr
)
&&
!
(
streamtype
=
MPEGSplitter_head_check
(
header
))
)
while
(
SUCCEEDED
(
hr
))
{
TRACE
(
"%x:%x:%x:%x
\n
"
,
header
[
0
],
header
[
1
],
header
[
2
],
header
[
3
]);
TRACE
(
"Testing header %x:%x:%x:%x
\n
"
,
header
[
0
],
header
[
1
],
header
[
2
],
header
[
3
]);
streamtype
=
MPEGSplitter_head_check
(
header
);
if
(
streamtype
==
MPEG_AUDIO_HEADER
)
{
LONGLONG
length
;
if
(
parse_header
(
header
,
&
length
,
NULL
)
==
S_OK
)
{
BYTE
next_header
[
4
];
/* Ensure we have a valid header by seeking for the next frame, some bad
* encoded ID3v2 may have an incorrect length and we end up finding bytes
* like FF FE 00 28 which are nothing more than a Unicode BOM followed by
* ')' character from inside a ID3v2 tag. Unfortunately that sequence
* matches like a valid mpeg audio header.
*/
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
+
length
-
4
,
4
,
next_header
);
if
(
FAILED
(
hr
))
break
;
if
(
parse_header
(
next_header
,
&
length
,
NULL
)
==
S_OK
)
break
;
TRACE
(
"%x:%x:%x:%x is a fake audio header, looking for next...
\n
"
,
header
[
0
],
header
[
1
],
header
[
2
],
header
[
3
]);
}
}
else
if
(
streamtype
)
/* Video or System stream */
break
;
/* No valid header yet; shift by a byte and check again */
memmove
(
header
,
header
+
1
,
3
);
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
++
,
1
,
header
+
3
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment