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
4b1f5e50
Commit
4b1f5e50
authored
Aug 14, 2014
by
Gabriel Dume
Committed by
Diego Biurrun
Aug 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosmetics: Write NULL pointer inequality checks more compactly
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
f929ab05
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
36 additions
and
36 deletions
+36
-36
cmdutils.c
cmdutils.c
+1
-1
dvdsubdec.c
libavcodec/dvdsubdec.c
+1
-1
h263dec.c
libavcodec/h263dec.c
+1
-1
h264_refs.c
libavcodec/h264_refs.c
+1
-1
libvpxenc.c
libavcodec/libvpxenc.c
+1
-1
libxvid.c
libavcodec/libxvid.c
+2
-2
mpeg12dec.c
libavcodec/mpeg12dec.c
+1
-1
qdm2.c
libavcodec/qdm2.c
+7
-7
rv10.c
libavcodec/rv10.c
+2
-2
rv34.c
libavcodec/rv34.c
+1
-1
utils.c
libavcodec/utils.c
+2
-2
vc1dec.c
libavcodec/vc1dec.c
+1
-1
avio.c
libavformat/avio.c
+1
-1
format.c
libavformat/format.c
+2
-2
http.c
libavformat/http.c
+1
-1
matroskadec.c
libavformat/matroskadec.c
+3
-3
movenc.c
libavformat/movenc.c
+1
-1
rtmpproto.c
libavformat/rtmpproto.c
+1
-1
segment.c
libavformat/segment.c
+1
-1
tls.c
libavformat/tls.c
+1
-1
url.c
libavformat/url.c
+1
-1
opt.c
libavutil/opt.c
+1
-1
audiogen.c
tests/audiogen.c
+1
-1
ismindex.c
tools/ismindex.c
+1
-1
No files found.
cmdutils.c
View file @
4b1f5e50
...
...
@@ -176,7 +176,7 @@ static const OptionDef *find_option(const OptionDef *po, const char *name)
const
char
*
p
=
strchr
(
name
,
':'
);
int
len
=
p
?
p
-
name
:
strlen
(
name
);
while
(
po
->
name
!=
NULL
)
{
while
(
po
->
name
)
{
if
(
!
strncmp
(
name
,
po
->
name
,
len
)
&&
strlen
(
po
->
name
)
==
len
)
break
;
po
++
;
...
...
libavcodec/dvdsubdec.c
View file @
4b1f5e50
...
...
@@ -314,7 +314,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
if
(
h
<
0
)
h
=
0
;
if
(
w
>
0
&&
h
>
0
)
{
if
(
sub_header
->
rects
!=
NULL
)
{
if
(
sub_header
->
rects
)
{
for
(
i
=
0
;
i
<
sub_header
->
num_rects
;
i
++
)
{
av_freep
(
&
sub_header
->
rects
[
i
]
->
pict
.
data
[
0
]);
av_freep
(
&
sub_header
->
rects
[
i
]
->
pict
.
data
[
1
]);
...
...
libavcodec/h263dec.c
View file @
4b1f5e50
...
...
@@ -625,7 +625,7 @@ intrax8_decoded:
if
((
ret
=
av_frame_ref
(
pict
,
s
->
current_picture_ptr
->
f
))
<
0
)
return
ret
;
ff_print_debug_info
(
s
,
s
->
current_picture_ptr
);
}
else
if
(
s
->
last_picture_ptr
!=
NULL
)
{
}
else
if
(
s
->
last_picture_ptr
)
{
if
((
ret
=
av_frame_ref
(
pict
,
s
->
last_picture_ptr
->
f
))
<
0
)
return
ret
;
ff_print_debug_info
(
s
,
s
->
last_picture_ptr
);
...
...
libavcodec/h264_refs.c
View file @
4b1f5e50
...
...
@@ -759,7 +759,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
(
h
->
max_pic_num
-
1
);
#if 0
if (mmco[i].short_pic_num >= h->short_ref_count ||
!h->short_ref[
mmco[i].short_pic_num
]) {
!h->short_ref[
mmco[i].short_pic_num
]) {
av_log(s->avctx, AV_LOG_ERROR,
"illegal short ref in memory management control "
"operation %d\n", mmco);
...
...
libavcodec/libvpxenc.c
View file @
4b1f5e50
...
...
@@ -159,7 +159,7 @@ static void coded_frame_add(void *list, struct FrameListData *cx_frame)
{
struct
FrameListData
**
p
=
list
;
while
(
*
p
!=
NULL
)
while
(
*
p
)
p
=
&
(
*
p
)
->
next
;
*
p
=
cx_frame
;
cx_frame
->
next
=
NULL
;
...
...
libavcodec/libxvid.c
View file @
4b1f5e50
...
...
@@ -127,7 +127,7 @@ static int xvid_ff_2pass_destroy(struct xvid_context *ref,
xvid_plg_destroy_t
*
param
)
{
/* Currently cannot think of anything to do on destruction */
/* Still, the framework should be here for reference/use */
if
(
ref
->
twopassbuffer
!=
NULL
)
if
(
ref
->
twopassbuffer
)
ref
->
twopassbuffer
[
0
]
=
0
;
return
0
;
}
...
...
@@ -772,7 +772,7 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) {
xvid_encore
(
x
->
encoder_handle
,
XVID_ENC_DESTROY
,
NULL
,
NULL
);
av_freep
(
&
avctx
->
extradata
);
if
(
x
->
twopassbuffer
!=
NULL
)
{
if
(
x
->
twopassbuffer
)
{
av_free
(
x
->
twopassbuffer
);
av_free
(
x
->
old_twopassbuffer
);
}
...
...
libavcodec/mpeg12dec.c
View file @
4b1f5e50
...
...
@@ -2028,7 +2028,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
s
->
picture_number
++
;
/* latency of 1 frame for I- and P-frames */
/* XXX: use another variable than picture_number */
if
(
s
->
last_picture_ptr
!=
NULL
)
{
if
(
s
->
last_picture_ptr
)
{
int
ret
=
av_frame_ref
(
pict
,
s
->
last_picture_ptr
->
f
);
if
(
ret
<
0
)
return
ret
;
...
...
libavcodec/qdm2.c
View file @
4b1f5e50
...
...
@@ -455,7 +455,7 @@ static void qdm2_decode_sub_packet_header(GetBitContext *gb,
static
QDM2SubPNode
*
qdm2_search_subpacket_type_in_list
(
QDM2SubPNode
*
list
,
int
type
)
{
while
(
list
!=
NULL
&&
list
->
packet
!=
NULL
)
{
while
(
list
&&
list
->
packet
)
{
if
(
list
->
packet
->
type
==
type
)
return
list
;
list
=
list
->
next
;
...
...
@@ -1211,23 +1211,23 @@ static void process_synthesis_subpackets(QDM2Context *q, QDM2SubPNode *list)
QDM2SubPNode
*
nodes
[
4
];
nodes
[
0
]
=
qdm2_search_subpacket_type_in_list
(
list
,
9
);
if
(
nodes
[
0
]
!=
NULL
)
if
(
nodes
[
0
])
process_subpacket_9
(
q
,
nodes
[
0
]);
nodes
[
1
]
=
qdm2_search_subpacket_type_in_list
(
list
,
10
);
if
(
nodes
[
1
]
!=
NULL
)
if
(
nodes
[
1
])
process_subpacket_10
(
q
,
nodes
[
1
]);
else
process_subpacket_10
(
q
,
NULL
);
nodes
[
2
]
=
qdm2_search_subpacket_type_in_list
(
list
,
11
);
if
(
nodes
[
0
]
!=
NULL
&&
nodes
[
1
]
!=
NULL
&&
nodes
[
2
]
!=
NULL
)
if
(
nodes
[
0
]
&&
nodes
[
1
]
&&
nodes
[
2
]
)
process_subpacket_11
(
q
,
nodes
[
2
]);
else
process_subpacket_11
(
q
,
NULL
);
nodes
[
3
]
=
qdm2_search_subpacket_type_in_list
(
list
,
12
);
if
(
nodes
[
0
]
!=
NULL
&&
nodes
[
1
]
!=
NULL
&&
nodes
[
3
]
!=
NULL
)
if
(
nodes
[
0
]
&&
nodes
[
1
]
&&
nodes
[
3
]
)
process_subpacket_12
(
q
,
nodes
[
3
]);
else
process_subpacket_12
(
q
,
NULL
);
...
...
@@ -1352,7 +1352,7 @@ static void qdm2_decode_super_block(QDM2Context *q)
}
}
// Packet bytes loop
if
(
q
->
sub_packet_list_D
[
0
].
packet
!=
NULL
)
{
if
(
q
->
sub_packet_list_D
[
0
].
packet
)
{
process_synthesis_subpackets
(
q
,
q
->
sub_packet_list_D
);
q
->
do_synth_filter
=
1
;
}
else
if
(
q
->
do_synth_filter
)
{
...
...
@@ -1939,7 +1939,7 @@ static int qdm2_decode(QDM2Context *q, const uint8_t *in, int16_t *out)
for
(
ch
=
0
;
ch
<
q
->
channels
;
ch
++
)
{
qdm2_calculate_fft
(
q
,
ch
,
q
->
sub_packet
);
if
(
!
q
->
has_errors
&&
q
->
sub_packet_list_C
[
0
].
packet
!=
NULL
)
{
if
(
!
q
->
has_errors
&&
q
->
sub_packet_list_C
[
0
].
packet
)
{
SAMPLES_NEEDED_2
(
"has errors, and C list is not empty"
)
return
-
1
;
}
...
...
libavcodec/rv10.c
View file @
4b1f5e50
...
...
@@ -737,7 +737,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
i
++
;
}
if
(
s
->
current_picture_ptr
!=
NULL
&&
s
->
mb_y
>=
s
->
mb_height
)
{
if
(
s
->
current_picture_ptr
&&
s
->
mb_y
>=
s
->
mb_height
)
{
ff_er_frame_end
(
&
s
->
er
);
ff_mpv_frame_end
(
s
);
...
...
@@ -745,7 +745,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if
((
ret
=
av_frame_ref
(
pict
,
s
->
current_picture_ptr
->
f
))
<
0
)
return
ret
;
ff_print_debug_info
(
s
,
s
->
current_picture_ptr
);
}
else
if
(
s
->
last_picture_ptr
!=
NULL
)
{
}
else
if
(
s
->
last_picture_ptr
)
{
if
((
ret
=
av_frame_ref
(
pict
,
s
->
last_picture_ptr
->
f
))
<
0
)
return
ret
;
ff_print_debug_info
(
s
,
s
->
last_picture_ptr
);
...
...
libavcodec/rv34.c
View file @
4b1f5e50
...
...
@@ -1591,7 +1591,7 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict)
return
ret
;
ff_print_debug_info
(
s
,
s
->
current_picture_ptr
);
got_picture
=
1
;
}
else
if
(
s
->
last_picture_ptr
!=
NULL
)
{
}
else
if
(
s
->
last_picture_ptr
)
{
if
((
ret
=
av_frame_ref
(
pict
,
s
->
last_picture_ptr
->
f
))
<
0
)
return
ret
;
ff_print_debug_info
(
s
,
s
->
last_picture_ptr
);
...
...
libavcodec/utils.c
View file @
4b1f5e50
...
...
@@ -107,7 +107,7 @@ av_cold void avcodec_register(AVCodec *codec)
AVCodec
**
p
;
avcodec_init
();
p
=
&
first_avcodec
;
while
(
*
p
!=
NULL
)
while
(
*
p
)
p
=
&
(
*
p
)
->
next
;
*
p
=
codec
;
codec
->
next
=
NULL
;
...
...
@@ -473,7 +473,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
FramePool
*
pool
=
s
->
internal
->
pool
;
int
i
;
if
(
pic
->
data
[
0
]
!=
NULL
)
{
if
(
pic
->
data
[
0
])
{
av_log
(
s
,
AV_LOG_ERROR
,
"pic->data[0]!=NULL in avcodec_default_get_buffer
\n
"
);
return
-
1
;
}
...
...
libavcodec/vc1dec.c
View file @
4b1f5e50
...
...
@@ -6114,7 +6114,7 @@ image:
goto
err
;
ff_print_debug_info
(
s
,
s
->
current_picture_ptr
);
*
got_frame
=
1
;
}
else
if
(
s
->
last_picture_ptr
!=
NULL
)
{
}
else
if
(
s
->
last_picture_ptr
)
{
if
((
ret
=
av_frame_ref
(
pict
,
s
->
last_picture_ptr
->
f
))
<
0
)
goto
err
;
ff_print_debug_info
(
s
,
s
->
last_picture_ptr
);
...
...
libavformat/avio.c
View file @
4b1f5e50
...
...
@@ -98,7 +98,7 @@ int ffurl_register_protocol(URLProtocol *protocol)
{
URLProtocol
**
p
;
p
=
&
first_protocol
;
while
(
*
p
!=
NULL
)
while
(
*
p
)
p
=
&
(
*
p
)
->
next
;
*
p
=
protocol
;
protocol
->
next
=
NULL
;
...
...
libavformat/format.c
View file @
4b1f5e50
...
...
@@ -56,7 +56,7 @@ void av_register_input_format(AVInputFormat *format)
{
AVInputFormat
**
p
=
&
first_iformat
;
while
(
*
p
!=
NULL
)
while
(
*
p
)
p
=
&
(
*
p
)
->
next
;
*
p
=
format
;
...
...
@@ -67,7 +67,7 @@ void av_register_output_format(AVOutputFormat *format)
{
AVOutputFormat
**
p
=
&
first_oformat
;
while
(
*
p
!=
NULL
)
while
(
*
p
)
p
=
&
(
*
p
)
->
next
;
*
p
=
format
;
...
...
libavformat/http.c
View file @
4b1f5e50
...
...
@@ -151,7 +151,7 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options)
proxy_path
=
getenv
(
"http_proxy"
);
use_proxy
=
!
ff_http_match_no_proxy
(
getenv
(
"no_proxy"
),
hostname
)
&&
proxy_path
!=
NULL
&&
av_strstart
(
proxy_path
,
"http://"
,
NULL
);
proxy_path
&&
av_strstart
(
proxy_path
,
"http://"
,
NULL
);
if
(
!
strcmp
(
proto
,
"https"
))
{
lower_proto
=
"tls"
;
...
...
libavformat/matroskadec.c
View file @
4b1f5e50
...
...
@@ -1583,7 +1583,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
if
(
!
strcmp
(
track
->
codec_id
,
"V_MS/VFW/FOURCC"
)
&&
track
->
codec_priv
.
size
>=
40
&&
track
->
codec_priv
.
data
!=
NULL
)
{
track
->
codec_priv
.
data
)
{
track
->
ms_compat
=
1
;
track
->
video
.
fourcc
=
AV_RL32
(
track
->
codec_priv
.
data
+
16
);
codec_id
=
ff_codec_get_id
(
ff_codec_bmp_tags
,
...
...
@@ -1591,7 +1591,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
extradata_offset
=
40
;
}
else
if
(
!
strcmp
(
track
->
codec_id
,
"A_MS/ACM"
)
&&
track
->
codec_priv
.
size
>=
14
&&
track
->
codec_priv
.
data
!=
NULL
)
{
track
->
codec_priv
.
data
)
{
int
ret
;
ffio_init_context
(
&
b
,
track
->
codec_priv
.
data
,
track
->
codec_priv
.
size
,
...
...
@@ -1603,7 +1603,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
extradata_offset
=
FFMIN
(
track
->
codec_priv
.
size
,
18
);
}
else
if
(
!
strcmp
(
track
->
codec_id
,
"V_QUICKTIME"
)
&&
(
track
->
codec_priv
.
size
>=
86
)
&&
(
track
->
codec_priv
.
data
!=
NULL
))
{
(
track
->
codec_priv
.
data
))
{
track
->
video
.
fourcc
=
AV_RL32
(
track
->
codec_priv
.
data
);
codec_id
=
ff_codec_get_id
(
ff_codec_movvideo_tags
,
track
->
video
.
fourcc
);
...
...
libavformat/movenc.c
View file @
4b1f5e50
...
...
@@ -3369,7 +3369,7 @@ static int mov_write_header(AVFormatContext *s)
/* Default mode == MP4 */
mov
->
mode
=
MODE_MP4
;
if
(
s
->
oformat
!=
NULL
)
{
if
(
s
->
oformat
)
{
if
(
!
strcmp
(
"3gp"
,
s
->
oformat
->
name
))
mov
->
mode
=
MODE_3GP
;
else
if
(
!
strcmp
(
"3g2"
,
s
->
oformat
->
name
))
mov
->
mode
=
MODE_3GP
|
MODE_3G2
;
else
if
(
!
strcmp
(
"mov"
,
s
->
oformat
->
name
))
mov
->
mode
=
MODE_MOV
;
...
...
libavformat/rtmpproto.c
View file @
4b1f5e50
...
...
@@ -375,7 +375,7 @@ static int gen_connect(URLContext *s, RTMPContext *rt)
char
*
param
=
rt
->
conn
;
// Write arbitrary AMF data to the Connect message.
while
(
param
!=
NULL
)
{
while
(
param
)
{
char
*
sep
;
param
+=
strspn
(
param
,
" "
);
if
(
!*
param
)
...
...
libavformat/segment.c
View file @
4b1f5e50
...
...
@@ -101,7 +101,7 @@ static int segment_hls_window(AVFormatContext *s, int last)
for
(
i
=
FFMAX
(
0
,
seg
->
number
-
seg
->
size
);
i
<
seg
->
number
;
i
++
)
{
avio_printf
(
seg
->
pb
,
"#EXTINF:%d,
\n
"
,
(
int
)
seg
->
time
);
if
(
seg
->
entry_prefix
!=
NULL
)
{
if
(
seg
->
entry_prefix
)
{
avio_printf
(
seg
->
pb
,
"%s"
,
seg
->
entry_prefix
);
}
av_get_frame_filename
(
buf
,
sizeof
(
buf
),
s
->
filename
,
i
);
...
...
libavformat/tls.c
View file @
4b1f5e50
...
...
@@ -164,7 +164,7 @@ static int tls_open(URLContext *h, const char *uri, int flags)
proxy_path
=
getenv
(
"http_proxy"
);
use_proxy
=
!
ff_http_match_no_proxy
(
getenv
(
"no_proxy"
),
host
)
&&
proxy_path
!=
NULL
&&
av_strstart
(
proxy_path
,
"http://"
,
NULL
);
proxy_path
&&
av_strstart
(
proxy_path
,
"http://"
,
NULL
);
if
(
use_proxy
)
{
char
proxy_host
[
200
],
proxy_auth
[
200
],
dest
[
200
];
...
...
libavformat/url.c
View file @
4b1f5e50
...
...
@@ -111,7 +111,7 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
/* Strip off any query string from base */
path_query
=
strchr
(
buf
,
'?'
);
if
(
path_query
!=
NULL
)
if
(
path_query
)
*
path_query
=
'\0'
;
/* Is relative path just a new query part? */
...
...
libavutil/opt.c
View file @
4b1f5e50
...
...
@@ -544,7 +544,7 @@ int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags)
void
av_opt_set_defaults
(
void
*
s
)
{
const
AVOption
*
opt
=
NULL
;
while
((
opt
=
av_opt_next
(
s
,
opt
))
!=
NULL
)
{
while
((
opt
=
av_opt_next
(
s
,
opt
)))
{
if
(
opt
->
flags
&
AV_OPT_FLAG_READONLY
)
continue
;
...
...
tests/audiogen.c
View file @
4b1f5e50
...
...
@@ -177,7 +177,7 @@ int main(int argc, char **argv)
return
1
;
}
if
((
ext
=
strrchr
(
argv
[
1
],
'.'
))
!=
NULL
&&
!
strcmp
(
ext
,
".wav"
))
if
((
ext
=
strrchr
(
argv
[
1
],
'.'
))
&&
!
strcmp
(
ext
,
".wav"
))
put_wav_header
(
sample_rate
,
nb_channels
,
6
*
sample_rate
);
/* 1 second of single freq sine at 1000 Hz */
...
...
tools/ismindex.c
View file @
4b1f5e50
...
...
@@ -323,7 +323,7 @@ static int handle_file(struct Tracks *tracks, const char *file, int split,
tracks
->
tracks
[
tracks
->
nb_tracks
]
=
track
;
track
->
name
=
file
;
if
((
ptr
=
strrchr
(
file
,
'/'
))
!=
NULL
)
if
((
ptr
=
strrchr
(
file
,
'/'
)))
track
->
name
=
ptr
+
1
;
track
->
bitrate
=
st
->
codec
->
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