aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-20 11:51:48 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commitebe45f58587d8754220f28a4e0f1ced3d74124f1 (patch)
tree967bd82ac4fa036c35cf8b13bfeca690182e147d
parentfc9e307043bec8d3f3980cd36a4f92e2bb600b13 (diff)
downloadffmpeg-ebe45f58587d8754220f28a4e0f1ced3d74124f1.tar.gz
avcodec/vp5/6/8: use vpX_rac_is_end()
Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ab56e62e8f7e02760cfc883956511cab32393315) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 1dd89192c59df0d6655e9308a0782d8c7b259b18) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vp5.c2
-rw-r--r--libavcodec/vp6.c2
-rw-r--r--libavcodec/vp8.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c
index b5f06a0940..6f9f43c6fa 100644
--- a/libavcodec/vp5.c
+++ b/libavcodec/vp5.c
@@ -183,7 +183,7 @@ static int vp5_parse_coeff(VP56Context *s)
int b, i, cg, idx, ctx, ctx_last;
int pt = 0; /* plane type (0 for Y, 1 for U or V) */
- if (c->end <= c->buffer && c->bits >= 0) {
+ if (vpX_rac_is_end(c)) {
av_log(s->avctx, AV_LOG_ERROR, "End of AC stream reached in vp5_parse_coeff\n");
return AVERROR_INVALIDDATA;
}
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index 4afd67b3a4..ef48b885f9 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -460,7 +460,7 @@ static int vp6_parse_coeff(VP56Context *s)
int b, i, cg, idx, ctx;
int pt = 0; /* plane type (0 for Y, 1 for U or V) */
- if (c->end <= c->buffer && c->bits >= 0) {
+ if (vpX_rac_is_end(c)) {
av_log(s->avctx, AV_LOG_ERROR, "End of AC stream reached in vp6_parse_coeff\n");
return AVERROR_INVALIDDATA;
}
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 2e796a1d21..4063938489 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -606,7 +606,7 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
s->fade_present = vp8_rac_get(c);
}
- if (c->end <= c->buffer && c->bits >= 0)
+ if (vpX_rac_is_end(c))
return AVERROR_INVALIDDATA;
/* E. Fading information for previous frame */
if (s->fade_present && vp8_rac_get(c)) {
@@ -2301,7 +2301,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
curframe->tf.f->data[2] + 8 * mb_y * s->uvlinesize
};
- if (c->end <= c->buffer && c->bits >= 0)
+ if (vpX_rac_is_end(c))
return AVERROR_INVALIDDATA;
if (mb_y == 0)
@@ -2332,7 +2332,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
s->mv_max.x = ((s->mb_width - 1) << 6) + MARGIN;
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) {
- if (c->end <= c->buffer && c->bits >= 0)
+ if (vpX_rac_is_end(c))
return AVERROR_INVALIDDATA;
// Wait for previous thread to read mb_x+2, and reach mb_y-1.
if (prev_td != td) {