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
73e8fab3
Commit
73e8fab3
authored
Feb 12, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: print values in case of error
Also make error style consistent and drop redundant information.
parent
f8c507f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
h264.c
libavcodec/h264.c
+12
-12
h264_parser.c
libavcodec/h264_parser.c
+5
-4
h264_ps.c
libavcodec/h264_ps.c
+6
-5
No files found.
libavcodec/h264.c
View file @
73e8fab3
...
...
@@ -1467,7 +1467,8 @@ int ff_h264_decode_extradata(H264Context *h)
h
->
is_avc
=
1
;
if
(
avctx
->
extradata_size
<
7
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"avcC too short
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"avcC %d too short
\n
"
,
avctx
->
extradata_size
);
return
AVERROR_INVALIDDATA
;
}
/* sps and pps in the avcC always have length coded with 2 bytes,
...
...
@@ -1734,7 +1735,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
ret
=
ff_h264_alloc_tables
(
h
);
if
(
ret
<
0
)
{
av_log
(
dst
,
AV_LOG_ERROR
,
"Could not allocate memory
for h264
\n
"
);
av_log
(
dst
,
AV_LOG_ERROR
,
"Could not allocate memory
\n
"
);
return
ret
;
}
ret
=
context_init
(
h
);
...
...
@@ -3072,7 +3073,7 @@ static int h264_set_parameter_from_sps(H264Context *h)
ff_dsputil_init
(
&
h
->
dsp
,
h
->
avctx
);
ff_videodsp_init
(
&
h
->
vdsp
,
h
->
sps
.
bit_depth_luma
);
}
else
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Unsupported bit depth
:
%d
\n
"
,
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Unsupported bit depth %d
\n
"
,
h
->
sps
.
bit_depth_luma
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -3125,7 +3126,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h)
break
;
default:
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Unsupported bit depth
:
%d
\n
"
,
h
->
sps
.
bit_depth_luma
);
"Unsupported bit depth %d
\n
"
,
h
->
sps
.
bit_depth_luma
);
return
AVERROR_INVALIDDATA
;
}
}
...
...
@@ -3196,8 +3197,7 @@ static int h264_slice_header_init(H264Context *h, int reinit)
init_scan_tables
(
h
);
ret
=
ff_h264_alloc_tables
(
h
);
if
(
ret
<
0
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Could not allocate memory for h264
\n
"
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Could not allocate memory
\n
"
);
return
ret
;
}
...
...
@@ -3207,7 +3207,7 @@ static int h264_slice_header_init(H264Context *h, int reinit)
max_slices
=
FFMIN
(
MAX_THREADS
,
h
->
mb_height
);
else
max_slices
=
MAX_THREADS
;
av_log
(
h
->
avctx
,
AV_LOG_WARNING
,
"too many threads/slices
(%d)
,"
av_log
(
h
->
avctx
,
AV_LOG_WARNING
,
"too many threads/slices
%d
,"
" reducing to %d
\n
"
,
nb_slices
,
max_slices
);
nb_slices
=
max_slices
;
}
...
...
@@ -3367,7 +3367,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
slice_type
=
get_ue_golomb_31
(
&
h
->
gb
);
if
(
slice_type
>
9
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"slice type
too large (%d)
at %d %d
\n
"
,
"slice type
%d too large
at %d %d
\n
"
,
h
->
slice_type
,
h
->
mb_x
,
h
->
mb_y
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -3396,7 +3396,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
pps_id
=
get_ue_golomb
(
&
h
->
gb
);
if
(
pps_id
>=
MAX_PPS_COUNT
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"pps_id
out of range
\n
"
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"pps_id
%u out of range
\n
"
,
pps_id
);
return
AVERROR_INVALIDDATA
;
}
if
(
!
h0
->
pps_buffers
[
pps_id
])
{
...
...
@@ -3547,7 +3547,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
return
AVERROR_INVALIDDATA
;
}
else
if
(
!
h0
->
cur_pic_ptr
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"unset cur_pic_ptr on
%d. slice
\n
"
,
"unset cur_pic_ptr on
slice %d
\n
"
,
h0
->
current_slice
+
1
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -3814,7 +3814,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
if
(
h
->
slice_type_nos
!=
AV_PICTURE_TYPE_I
&&
h
->
pps
.
cabac
)
{
tmp
=
get_ue_golomb_31
(
&
h
->
gb
);
if
(
tmp
>
2
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"cabac_init_idc
overflow
\n
"
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"cabac_init_idc
%u overflow
\n
"
,
tmp
);
return
AVERROR_INVALIDDATA
;
}
h
->
cabac_init_idc
=
tmp
;
...
...
@@ -4386,7 +4386,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
}
if
(
ret
<
0
||
h
->
cabac
.
bytestream
>
h
->
cabac
.
bytestream_end
+
2
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"error while decoding MB %d %d, bytestream
(%td)
\n
"
,
"error while decoding MB %d %d, bytestream
%td
\n
"
,
h
->
mb_x
,
h
->
mb_y
,
h
->
cabac
.
bytestream_end
-
h
->
cabac
.
bytestream
);
er_add_slice
(
h
,
h
->
resync_mb_x
,
h
->
resync_mb_y
,
h
->
mb_x
,
...
...
libavcodec/h264_parser.c
View file @
73e8fab3
...
...
@@ -118,7 +118,8 @@ static int scan_mmco_reset(AVCodecParserContext *s)
break
;
if
(
index
>=
h
->
ref_count
[
list
])
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"reference count overflow
\n
"
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"reference count %d overflow
\n
"
,
index
);
return
AVERROR_INVALIDDATA
;
}
}
...
...
@@ -244,18 +245,18 @@ static inline int parse_nal_units(AVCodecParserContext *s,
pps_id
=
get_ue_golomb
(
&
h
->
gb
);
if
(
pps_id
>=
MAX_PPS_COUNT
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"pps_id
out of range
\n
"
);
"pps_id
%u out of range
\n
"
,
pps_id
);
return
-
1
;
}
if
(
!
h
->
pps_buffers
[
pps_id
])
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"non-existing PPS
referenced
\n
"
);
"non-existing PPS
%u referenced
\n
"
,
pps_id
);
return
-
1
;
}
h
->
pps
=
*
h
->
pps_buffers
[
pps_id
];
if
(
!
h
->
sps_buffers
[
h
->
pps
.
sps_id
])
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"non-existing SPS
referenced
\n
"
);
"non-existing SPS
%u referenced
\n
"
,
h
->
pps
.
sps_id
);
return
-
1
;
}
h
->
sps
=
*
h
->
sps_buffers
[
h
->
pps
.
sps_id
];
...
...
libavcodec/h264_ps.c
View file @
73e8fab3
...
...
@@ -311,7 +311,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
sps_id
=
get_ue_golomb_31
(
&
h
->
gb
);
if
(
sps_id
>=
MAX_SPS_COUNT
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"sps_id
(%d)
out of range
\n
"
,
sps_id
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"sps_id
%u
out of range
\n
"
,
sps_id
);
return
AVERROR_INVALIDDATA
;
}
sps
=
av_mallocz
(
sizeof
(
SPS
));
...
...
@@ -335,7 +335,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
sps
->
chroma_format_idc
=
get_ue_golomb_31
(
&
h
->
gb
);
if
(
sps
->
chroma_format_idc
>
3
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"chroma_format_idc
(%u)
out of range
\n
"
,
"chroma_format_idc
%u
out of range
\n
"
,
sps
->
chroma_format_idc
);
goto
fail
;
}
else
if
(
sps
->
chroma_format_idc
==
3
)
{
...
...
@@ -394,7 +394,8 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
sps
->
ref_frame_count
=
get_ue_golomb_31
(
&
h
->
gb
);
if
(
sps
->
ref_frame_count
>
MAX_PICTURE_COUNT
-
2
||
sps
->
ref_frame_count
>=
32U
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"too many reference frames
\n
"
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"too many reference frames %d
\n
"
,
sps
->
ref_frame_count
);
goto
fail
;
}
sps
->
gaps_in_frame_num_allowed_flag
=
get_bits1
(
&
h
->
gb
);
...
...
@@ -529,7 +530,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
int
bits_left
;
if
(
pps_id
>=
MAX_PPS_COUNT
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"pps_id
(%d)
out of range
\n
"
,
pps_id
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"pps_id
%u
out of range
\n
"
,
pps_id
);
return
AVERROR_INVALIDDATA
;
}
else
if
(
h
->
sps
.
bit_depth_luma
>
10
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
...
...
@@ -544,7 +545,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
pps
->
sps_id
=
get_ue_golomb_31
(
&
h
->
gb
);
if
((
unsigned
)
pps
->
sps_id
>=
MAX_SPS_COUNT
||
h
->
sps_buffers
[
pps
->
sps_id
]
==
NULL
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"sps_id
out of range
\n
"
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"sps_id
%u out of range
\n
"
,
pps
->
sps_id
);
goto
fail
;
}
...
...
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