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
09c274e0
Commit
09c274e0
authored
Aug 16, 2011
by
Dustin Brody
Committed by
Ronald S. Bultje
Aug 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg12: propagate chunk decode errors and fix conditional indentation
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
0d802ac5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
mpeg12.c
libavcodec/mpeg12.c
+24
-4
No files found.
libavcodec/mpeg12.c
View file @
09c274e0
...
...
@@ -1911,6 +1911,8 @@ static int slice_decode_thread(AVCodecContext *c, void *arg){
//av_log(c, AV_LOG_DEBUG, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
//ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, s->start_mb_y, s->end_mb_y, s->error_count);
if
(
ret
<
0
){
if
(
c
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
if
(
s
->
resync_mb_x
>=
0
&&
s
->
resync_mb_y
>=
0
)
ff_er_add_slice
(
s
,
s
->
resync_mb_x
,
s
->
resync_mb_y
,
s
->
mb_x
,
s
->
mb_y
,
AC_ERROR
|
DC_ERROR
|
MV_ERROR
);
}
else
{
...
...
@@ -2265,8 +2267,10 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
s
->
slice_count
=
0
;
if
(
avctx
->
extradata
&&
!
avctx
->
frame_number
)
decode_chunks
(
avctx
,
picture
,
data_size
,
avctx
->
extradata
,
avctx
->
extradata_size
);
if
(
avctx
->
extradata
&&
!
avctx
->
frame_number
&&
decode_chunks
(
avctx
,
picture
,
data_size
,
avctx
->
extradata
,
avctx
->
extradata_size
)
<
0
&&
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
return
decode_chunks
(
avctx
,
picture
,
data_size
,
buf
,
buf_size
);
}
...
...
@@ -2323,6 +2327,8 @@ static int decode_chunks(AVCodecContext *avctx,
s
->
sync
=
1
;
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ignoring SEQ_START_CODE after %X
\n
"
,
last_code
);
if
(
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
}
break
;
...
...
@@ -2351,6 +2357,8 @@ static int decode_chunks(AVCodecContext *avctx,
last_code
=
PICTURE_START_CODE
;
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ignoring pic after %X
\n
"
,
last_code
);
if
(
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
}
break
;
case
EXT_START_CODE
:
...
...
@@ -2362,6 +2370,8 @@ static int decode_chunks(AVCodecContext *avctx,
mpeg_decode_sequence_extension
(
s
);
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ignoring seq ext after %X
\n
"
,
last_code
);
if
(
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
}
break
;
case
0x2
:
...
...
@@ -2378,6 +2388,8 @@ static int decode_chunks(AVCodecContext *avctx,
mpeg_decode_picture_coding_extension
(
s
);
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ignoring pic cod ext after %X
\n
"
,
last_code
);
if
(
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
}
break
;
}
...
...
@@ -2394,6 +2406,8 @@ static int decode_chunks(AVCodecContext *avctx,
s
->
sync
=
1
;
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ignoring GOP_START_CODE after %X
\n
"
,
last_code
);
if
(
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
}
break
;
default:
...
...
@@ -2438,6 +2452,8 @@ static int decode_chunks(AVCodecContext *avctx,
if
(
!
s2
->
pict_type
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"Missing picture start code
\n
"
);
if
(
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
break
;
}
...
...
@@ -2448,6 +2464,8 @@ static int decode_chunks(AVCodecContext *avctx,
}
if
(
!
s2
->
current_picture_ptr
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"current_picture not initialized
\n
"
);
if
(
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
return
-
1
;
}
...
...
@@ -2476,6 +2494,8 @@ static int decode_chunks(AVCodecContext *avctx,
emms_c
();
if
(
ret
<
0
){
if
(
avctx
->
error_recognition
>=
FF_ER_EXPLODE
)
return
AVERROR_INVALIDDATA
;
if
(
s2
->
resync_mb_x
>=
0
&&
s2
->
resync_mb_y
>=
0
)
ff_er_add_slice
(
s2
,
s2
->
resync_mb_x
,
s2
->
resync_mb_y
,
s2
->
mb_x
,
s2
->
mb_y
,
AC_ERROR
|
DC_ERROR
|
MV_ERROR
);
}
else
{
...
...
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