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
9dbbda23
Commit
9dbbda23
authored
Nov 17, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vb: return meaningful error codes.
parent
a0ffcee1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
vb.c
libavcodec/vb.c
+5
-5
No files found.
libavcodec/vb.c
View file @
9dbbda23
...
@@ -123,7 +123,7 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
...
@@ -123,7 +123,7 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
if
(
!
t
){
//raw block
if
(
!
t
){
//raw block
if
(
bytestream2_get_bytes_left
(
&
g
)
<
16
)
{
if
(
bytestream2_get_bytes_left
(
&
g
)
<
16
)
{
av_log
(
c
->
avctx
,
AV_LOG_ERROR
,
"Insufficient data
\n
"
);
av_log
(
c
->
avctx
,
AV_LOG_ERROR
,
"Insufficient data
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
for
(
y
=
0
;
y
<
4
;
y
++
)
for
(
y
=
0
;
y
<
4
;
y
++
)
bytestream2_get_buffer
(
&
g
,
cur
+
y
*
width
,
4
);
bytestream2_get_buffer
(
&
g
,
cur
+
y
*
width
,
4
);
...
@@ -168,7 +168,7 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
...
@@ -168,7 +168,7 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
break
;
break
;
case
3
:
case
3
:
av_log
(
c
->
avctx
,
AV_LOG_ERROR
,
"Invalid opcode seen @%d
\n
"
,
blk
);
av_log
(
c
->
avctx
,
AV_LOG_ERROR
,
"Invalid opcode seen @%d
\n
"
,
blk
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
break
;
break
;
}
}
...
@@ -190,7 +190,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -190,7 +190,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
{
{
VBDecContext
*
const
c
=
avctx
->
priv_data
;
VBDecContext
*
const
c
=
avctx
->
priv_data
;
uint8_t
*
outptr
,
*
srcptr
;
uint8_t
*
outptr
,
*
srcptr
;
int
i
,
j
;
int
i
,
j
,
ret
;
int
flags
;
int
flags
;
uint32_t
size
;
uint32_t
size
;
int
offset
=
0
;
int
offset
=
0
;
...
@@ -200,9 +200,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
...
@@ -200,9 +200,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if
(
c
->
pic
.
data
[
0
])
if
(
c
->
pic
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
c
->
pic
);
avctx
->
release_buffer
(
avctx
,
&
c
->
pic
);
c
->
pic
.
reference
=
1
;
c
->
pic
.
reference
=
1
;
if
(
ff_get_buffer
(
avctx
,
&
c
->
pic
)
<
0
)
{
if
((
ret
=
ff_get_buffer
(
avctx
,
&
c
->
pic
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
}
flags
=
bytestream2_get_le16
(
&
c
->
stream
);
flags
=
bytestream2_get_le16
(
&
c
->
stream
);
...
...
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