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
0273ceeb
Commit
0273ceeb
authored
Jul 08, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
few more error checks
Originally committed as revision 2021 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3f6f76af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
mjpeg.c
libavcodec/mjpeg.c
+9
-4
No files found.
libavcodec/mjpeg.c
View file @
0273ceeb
...
...
@@ -842,7 +842,7 @@ typedef struct MJpegDecodeContext {
static
int
mjpeg_decode_dht
(
MJpegDecodeContext
*
s
);
static
void
build_vlc
(
VLC
*
vlc
,
const
uint8_t
*
bits_table
,
const
uint8_t
*
val_table
,
static
int
build_vlc
(
VLC
*
vlc
,
const
uint8_t
*
bits_table
,
const
uint8_t
*
val_table
,
int
nb_codes
)
{
uint8_t
huff_size
[
256
];
...
...
@@ -851,7 +851,7 @@ static void build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_ta
memset
(
huff_size
,
0
,
sizeof
(
huff_size
));
build_huffman_codes
(
huff_size
,
huff_code
,
bits_table
,
val_table
);
init_vlc
(
vlc
,
9
,
nb_codes
,
huff_size
,
1
,
1
,
huff_code
,
2
,
2
);
return
init_vlc
(
vlc
,
9
,
nb_codes
,
huff_size
,
1
,
1
,
huff_code
,
2
,
2
);
}
static
int
mjpeg_decode_init
(
AVCodecContext
*
avctx
)
...
...
@@ -970,7 +970,9 @@ static int mjpeg_decode_dht(MJpegDecodeContext *s)
free_vlc
(
&
s
->
vlcs
[
class
][
index
]);
dprintf
(
"class=%d index=%d nb_codes=%d
\n
"
,
class
,
index
,
code_max
+
1
);
build_vlc
(
&
s
->
vlcs
[
class
][
index
],
bits_table
,
val_table
,
code_max
+
1
);
if
(
build_vlc
(
&
s
->
vlcs
[
class
][
index
],
bits_table
,
val_table
,
code_max
+
1
)
<
0
){
return
-
1
;
}
}
return
0
;
}
...
...
@@ -1778,7 +1780,10 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
mjpeg_decode_dqt
(
s
);
break
;
case
DHT
:
mjpeg_decode_dht
(
s
);
if
(
mjpeg_decode_dht
(
s
)
<
0
){
fprintf
(
stderr
,
"huffman table decode error
\n
"
);
return
-
1
;
}
break
;
case
SOF0
:
s
->
lossless
=
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