Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
9bd4a9f4
Commit
9bd4a9f4
authored
Mar 20, 2014
by
Michael Niedermayer
Committed by
Vittorio Giovara
Mar 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isom: Simplify mov_rewrite_dvd_sub_extradata()
This avoids the 2nd buffer and fixes the palette truncated check
parent
3e4e2142
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
isom.c
libavformat/isom.c
+8
-10
No files found.
libavformat/isom.c
View file @
9bd4a9f4
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "isom.h"
#include "isom.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/mpegaudiodata.h"
#include "libavcodec/mpegaudiodata.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
/* http://www.mp4ra.org */
/* http://www.mp4ra.org */
...
@@ -438,28 +439,25 @@ static uint32_t yuv_to_rgba(uint32_t ycbcr)
...
@@ -438,28 +439,25 @@ static uint32_t yuv_to_rgba(uint32_t ycbcr)
static
int
mov_rewrite_dvd_sub_extradata
(
AVStream
*
st
)
static
int
mov_rewrite_dvd_sub_extradata
(
AVStream
*
st
)
{
{
char
pal_s
[
256
];
char
buf
[
256
]
=
{
0
};
char
buf
[
256
];
int
pal_s_pos
=
0
;
uint8_t
*
src
=
st
->
codec
->
extradata
;
uint8_t
*
src
=
st
->
codec
->
extradata
;
int
i
;
int
i
;
if
(
st
->
codec
->
extradata_size
!=
64
)
if
(
st
->
codec
->
extradata_size
!=
64
)
return
0
;
return
0
;
snprintf
(
buf
,
sizeof
(
buf
),
"size: %dx%d
\n
palette: "
,
st
->
codec
->
width
,
st
->
codec
->
height
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
uint32_t
yuv
=
AV_RB32
(
src
+
i
*
4
);
uint32_t
yuv
=
AV_RB32
(
src
+
i
*
4
);
uint32_t
rgba
=
yuv_to_rgba
(
yuv
);
uint32_t
rgba
=
yuv_to_rgba
(
yuv
);
snprintf
(
pal_s
+
pal_s_pos
,
sizeof
(
pal_s
)
-
pal_s_pos
,
"%06x%s"
,
rgba
,
av_strlcatf
(
buf
,
sizeof
(
buf
),
"%06x%s"
,
rgba
,
i
!=
15
?
", "
:
""
);
i
!=
15
?
", "
:
""
);
pal_s_pos
=
strlen
(
pal_s
);
if
(
pal_s_pos
>=
sizeof
(
pal_s
))
return
0
;
}
}
snprintf
(
buf
,
sizeof
(
buf
),
"size: %dx%d
\n
palette: %s
\n
"
,
if
(
av_strlcat
(
buf
,
"
\n
"
,
sizeof
(
buf
))
>=
sizeof
(
buf
))
st
->
codec
->
width
,
st
->
codec
->
height
,
pal_s
)
;
return
0
;
av_freep
(
&
st
->
codec
->
extradata
);
av_freep
(
&
st
->
codec
->
extradata
);
st
->
codec
->
extradata_size
=
0
;
st
->
codec
->
extradata_size
=
0
;
...
...
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