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
aec50f79
Commit
aec50f79
authored
Jan 03, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rawdec: use AVPALETTE_SIZE instead of magic constants.
parent
e6da5d21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
rawdec.c
libavcodec/rawdec.c
+3
-2
No files found.
libavcodec/rawdec.c
View file @
aec50f79
...
...
@@ -138,14 +138,15 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
frame
->
reordered_opaque
=
avctx
->
reordered_opaque
;
frame
->
pkt_pts
=
avctx
->
pkt
->
pts
;
if
(
buf_size
<
context
->
length
-
(
avctx
->
pix_fmt
==
AV_PIX_FMT_PAL8
?
256
*
4
:
0
))
if
(
buf_size
<
context
->
length
-
(
avctx
->
pix_fmt
==
AV_PIX_FMT_PAL8
?
AVPALETTE_SIZE
:
0
))
return
-
1
;
//2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
if
(
context
->
buffer
)
{
int
i
;
uint8_t
*
dst
=
context
->
buffer
;
buf_size
=
context
->
length
-
256
*
4
;
buf_size
=
context
->
length
-
AVPALETTE_SIZE
;
if
(
avctx
->
bits_per_coded_sample
==
4
)
{
for
(
i
=
0
;
2
*
i
+
1
<
buf_size
;
i
++
)
{
dst
[
2
*
i
+
0
]
=
buf
[
i
]
>>
4
;
...
...
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