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
178cd50c
Commit
178cd50c
authored
Feb 24, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/scpr: make sure that component value is <= 0x1F for 16 bpc
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
fa3e4956
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
scpr.c
libavcodec/scpr.c
+3
-1
No files found.
libavcodec/scpr.c
View file @
178cd50c
...
@@ -58,6 +58,7 @@ typedef struct SCPRContext {
...
@@ -58,6 +58,7 @@ typedef struct SCPRContext {
unsigned
nbx
,
nby
;
unsigned
nbx
,
nby
;
unsigned
nbcount
;
unsigned
nbcount
;
unsigned
*
blocks
;
unsigned
*
blocks
;
unsigned
cbits
;
int
cxshift
;
int
cxshift
;
}
SCPRContext
;
}
SCPRContext
;
...
@@ -241,7 +242,7 @@ static int decode_unit(SCPRContext *s, PixelModel *pixel, unsigned step, unsigne
...
@@ -241,7 +242,7 @@ static int decode_unit(SCPRContext *s, PixelModel *pixel, unsigned step, unsigne
}
}
pixel
->
total_freq
=
totfr
;
pixel
->
total_freq
=
totfr
;
*
rval
=
c
;
*
rval
=
c
&
s
->
cbits
;
return
0
;
return
0
;
}
}
...
@@ -789,6 +790,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -789,6 +790,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
}
s
->
cxshift
=
avctx
->
bits_per_coded_sample
==
16
?
0
:
2
;
s
->
cxshift
=
avctx
->
bits_per_coded_sample
==
16
?
0
:
2
;
s
->
cbits
=
avctx
->
bits_per_coded_sample
==
16
?
0x1F
:
0xFF
;
s
->
nbx
=
(
avctx
->
width
+
15
)
/
16
;
s
->
nbx
=
(
avctx
->
width
+
15
)
/
16
;
s
->
nby
=
(
avctx
->
height
+
15
)
/
16
;
s
->
nby
=
(
avctx
->
height
+
15
)
/
16
;
s
->
nbcount
=
s
->
nbx
*
s
->
nby
;
s
->
nbcount
=
s
->
nbx
*
s
->
nby
;
...
...
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