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
aaf02f6e
Commit
aaf02f6e
authored
Oct 24, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/rmdec: add some error messages
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f7106e00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
rmdec.c
libavformat/rmdec.c
+13
-4
No files found.
libavformat/rmdec.c
View file @
aaf02f6e
...
...
@@ -680,16 +680,20 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
pos
=
get_num
(
pb
,
&
len
);
pic_num
=
avio_r8
(
pb
);
len
--
;
}
if
(
len
<
0
)
if
(
len
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Insuffient data
\n
"
);
return
-
1
;
}
rm
->
remaining_len
=
len
;
if
(
type
&
1
){
// frame, not slice
if
(
type
==
3
){
// frame as a part of packet
len
=
len2
;
*
timestamp
=
pos
;
}
if
(
rm
->
remaining_len
<
len
)
if
(
rm
->
remaining_len
<
len
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Insuffient remaining len
\n
"
);
return
-
1
;
}
rm
->
remaining_len
-=
len
;
if
(
av_new_packet
(
pkt
,
len
+
9
)
<
0
)
return
AVERROR
(
EIO
);
...
...
@@ -698,6 +702,7 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
AV_WL32
(
pkt
->
data
+
5
,
0
);
if
((
ret
=
avio_read
(
pb
,
pkt
->
data
+
9
,
len
))
!=
len
)
{
av_free_packet
(
pkt
);
av_log
(
s
,
AV_LOG_ERROR
,
"Failed to read %d bytes
\n
"
,
len
);
return
ret
<
0
?
ret
:
AVERROR
(
EIO
);
}
return
0
;
...
...
@@ -724,14 +729,18 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
if
(
type
==
2
)
len
=
FFMIN
(
len
,
pos
);
if
(
++
vst
->
cur_slice
>
vst
->
slices
)
if
(
++
vst
->
cur_slice
>
vst
->
slices
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"cur slice %d, too large
\n
"
,
vst
->
cur_slice
);
return
1
;
}
if
(
!
vst
->
pkt
.
data
)
return
AVERROR
(
ENOMEM
);
AV_WL32
(
vst
->
pkt
.
data
-
7
+
8
*
vst
->
cur_slice
,
1
);
AV_WL32
(
vst
->
pkt
.
data
-
3
+
8
*
vst
->
cur_slice
,
vst
->
videobufpos
-
8
*
vst
->
slices
-
1
);
if
(
vst
->
videobufpos
+
len
>
vst
->
videobufsize
)
if
(
vst
->
videobufpos
+
len
>
vst
->
videobufsize
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"outside videobufsize
\n
"
);
return
1
;
}
if
(
avio_read
(
pb
,
vst
->
pkt
.
data
+
vst
->
videobufpos
,
len
)
!=
len
)
return
AVERROR
(
EIO
);
vst
->
videobufpos
+=
len
;
...
...
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