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
579d21f7
Commit
579d21f7
authored
Nov 25, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tga: check palette size earlier.
Fixes Ticket1895 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e55c3857
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
targa.c
libavcodec/targa.c
+5
-4
No files found.
libavcodec/targa.c
View file @
579d21f7
...
...
@@ -172,6 +172,11 @@ static int decode_frame(AVCodecContext *avctx,
if
(
s
->
picture
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
picture
);
if
(
colors
&&
(
colors
+
first_clr
)
>
256
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Incorrect palette: %i colors with offset %i
\n
"
,
colors
,
first_clr
);
return
AVERROR_INVALIDDATA
;
}
if
((
ret
=
av_image_check_size
(
w
,
h
,
0
,
avctx
)))
return
ret
;
if
(
w
!=
avctx
->
width
||
h
!=
avctx
->
height
)
...
...
@@ -194,10 +199,6 @@ static int decode_frame(AVCodecContext *avctx,
if
(
colors
)
{
int
pal_size
,
pal_sample_size
;
if
((
colors
+
first_clr
)
>
256
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Incorrect palette: %i colors with offset %i
\n
"
,
colors
,
first_clr
);
return
AVERROR_INVALIDDATA
;
}
switch
(
csize
)
{
case
32
:
pal_sample_size
=
4
;
break
;
case
24
:
pal_sample_size
=
3
;
break
;
...
...
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