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
17a54f5d
Commit
17a54f5d
authored
Jun 25, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/rawdec: prefer constant AVPALETTE_SIZE over 256*4
Improve readability.
parent
4330b8bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
rawdec.c
libavcodec/rawdec.c
+2
-2
No files found.
libavcodec/rawdec.c
View file @
17a54f5d
...
...
@@ -171,7 +171,7 @@ static int raw_decode(AVCodecContext *avctx,
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
<
avpkt
->
size
;
i
++
){
dst
[
2
*
i
+
0
]
=
buf
[
i
]
>>
4
;
...
...
@@ -194,7 +194,7 @@ static int raw_decode(AVCodecContext *avctx,
avctx
->
codec_tag
==
MKTAG
(
'A'
,
'V'
,
'u'
,
'p'
))
buf
+=
buf_size
-
context
->
length
;
len
=
context
->
length
-
(
avctx
->
pix_fmt
==
PIX_FMT_PAL8
?
256
*
4
:
0
);
len
=
context
->
length
-
(
avctx
->
pix_fmt
==
PIX_FMT_PAL8
?
AVPALETTE_SIZE
:
0
);
if
(
buf_size
<
len
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid buffer size, packet size %d < expected length %d
\n
"
,
buf_size
,
len
);
return
AVERROR
(
EINVAL
);
...
...
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