summaryrefslogtreecommitdiff
path: root/libavcodec/h264_mp4toannexb_bsf.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-12-14 23:19:22 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-03-06 00:58:31 +0100
commit84c87e41a68dc4164a2a130504cd9c5b4413b744 (patch)
tree65a9ca2db33e92212e3ca28f0905a6add137871e /libavcodec/h264_mp4toannexb_bsf.c
parentc177520f675945bf884223ea72bc68b7a4bea30f (diff)
downloadffmpeg-84c87e41a68dc4164a2a130504cd9c5b4413b744.tar.gz
h264_mp4toannexb: Consistently use pointer comparisons
h264_mp4toannexb_filter currently uses both indices/offsets as well as direct pointers comparisons for the checks whether one has reached or even surpassed the end. This commit removes the offsets. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/h264_mp4toannexb_bsf.c')
-rw-r--r--libavcodec/h264_mp4toannexb_bsf.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index c28e02ae55..1505ee1c3d 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -176,10 +176,8 @@ static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out)
AVPacket *in;
uint8_t unit_type;
int32_t nal_size;
- uint32_t cumul_size = 0;
const uint8_t *buf;
const uint8_t *buf_end;
- int buf_size;
int ret = 0, i;
ret = ff_bsf_get_packet(ctx, &in);
@@ -194,7 +192,6 @@ static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out)
}
buf = in->data;
- buf_size = in->size;
buf_end = in->data + in->size;
do {
@@ -262,8 +259,7 @@ static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out)
}
buf += nal_size;
- cumul_size += nal_size + s->length_size;
- } while (cumul_size < buf_size);
+ } while (buf < buf_end);
ret = av_packet_copy_props(out, in);
if (ret < 0)