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
dff6c925
Commit
dff6c925
authored
Jan 18, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpegvideo_parser: Check the ff_set_dimensions() return code
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
741fa049
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
mpegvideo_parser.c
libavcodec/mpegvideo_parser.c
+6
-2
No files found.
libavcodec/mpegvideo_parser.c
View file @
dff6c925
...
...
@@ -44,6 +44,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
int
top_field_first
,
repeat_first_field
,
progressive_frame
;
int
horiz_size_ext
,
vert_size_ext
,
bit_rate_ext
;
int
did_set_size
=
0
;
int
set_dim_ret
=
0
;
int
bit_rate
=
0
;
int
vbv_delay
=
0
;
//FIXME replace the crap with get_bits()
...
...
@@ -66,7 +67,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
pc
->
width
=
(
buf
[
0
]
<<
4
)
|
(
buf
[
1
]
>>
4
);
pc
->
height
=
((
buf
[
1
]
&
0x0f
)
<<
8
)
|
buf
[
2
];
if
(
!
avctx
->
width
||
!
avctx
->
height
||
!
avctx
->
coded_width
||
!
avctx
->
coded_height
){
ff_set_dimensions
(
avctx
,
pc
->
width
,
pc
->
height
);
set_dim_ret
=
ff_set_dimensions
(
avctx
,
pc
->
width
,
pc
->
height
);
did_set_size
=
1
;
}
frame_rate_index
=
buf
[
3
]
&
0xf
;
...
...
@@ -94,7 +95,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
pc
->
height
=
(
pc
->
height
&
0xFFF
)
|
(
vert_size_ext
<<
12
);
bit_rate
=
(
bit_rate
&
0x3FFFF
)
|
(
bit_rate_ext
<<
18
);
if
(
did_set_size
)
ff_set_dimensions
(
avctx
,
pc
->
width
,
pc
->
height
);
set_dim_ret
=
ff_set_dimensions
(
avctx
,
pc
->
width
,
pc
->
height
);
avctx
->
framerate
.
num
=
pc
->
frame_rate
.
num
*
(
frame_rate_ext_n
+
1
);
avctx
->
framerate
.
den
=
pc
->
frame_rate
.
den
*
(
frame_rate_ext_d
+
1
);
avctx
->
codec_id
=
AV_CODEC_ID_MPEG2VIDEO
;
...
...
@@ -144,6 +145,9 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
}
}
the_end:
;
if
(
set_dim_ret
<
0
)
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to set dimensions
\n
"
);
if
(
avctx
->
codec_id
==
AV_CODEC_ID_MPEG2VIDEO
&&
bit_rate
)
{
avctx
->
rc_max_rate
=
400
*
bit_rate
;
}
...
...
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