diff options
author | Gabriel Dume <gabriel.ddx84@gmail.com> | 2014-08-14 16:31:24 -0400 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2014-08-15 03:18:18 -0700 |
commit | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 (patch) | |
tree | 5b93402fb37cc43b899451a5d2b65bfc03d7887b /libavcodec/h264.c | |
parent | efd26bedec9a345a5960dbfcbaec888418f2d4e6 (diff) | |
download | ffmpeg-f929ab0569ff31ed5a59b0b0adb7ce09df3fca39.tar.gz |
cosmetics: Write NULL pointer equality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 7d1109cb89..1fd5e506cd 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -286,7 +286,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, length + FF_INPUT_BUFFER_PADDING_SIZE); dst = h->rbsp_buffer[bufidx]; - if (dst == NULL) + if (!dst) return NULL; memcpy(dst, src, i); @@ -1379,7 +1379,7 @@ static int get_last_needed_nal(H264Context *h, const uint8_t *buf, int buf_size) ptr = ff_h264_decode_nal(h, buf + buf_index, &dst_length, &consumed, next_avc - buf_index); - if (ptr == NULL || dst_length < 0) + if (!ptr || dst_length < 0) return AVERROR_INVALIDDATA; buf_index += consumed; @@ -1460,7 +1460,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size, ptr = ff_h264_decode_nal(hx, buf + buf_index, &dst_length, &consumed, next_avc - buf_index); - if (ptr == NULL || dst_length < 0) { + if (!ptr || dst_length < 0) { ret = -1; goto end; } |