summaryrefslogtreecommitdiff
path: root/libavcodec/h261dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-30 18:28:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-10-30 18:28:00 +0100
commit711e981276d02895605a7099c4f873771d616c77 (patch)
tree9942157e01d37994d2adef5ac85b3ae0d8b47dfa /libavcodec/h261dec.c
parent9c284a8e1935e7aecc84fae429404becd683aa35 (diff)
avcodec/h261dec: Use skip_1stop_8data_bits()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h261dec.c')
-rw-r--r--libavcodec/h261dec.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 2995d8ca35..26b885587f 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -125,11 +125,8 @@ static int h261_decode_gob_header(H261Context *h)
}
/* GEI */
- while (get_bits1(&s->gb) != 0) {
- skip_bits(&s->gb, 8);
- if (get_bits_left(&s->gb) <= 0)
- return AVERROR_INVALIDDATA;
- }
+ if (skip_1stop_8data_bits(&s->gb) < 0)
+ return AVERROR_INVALIDDATA;
if (s->qscale == 0) {
av_log(s->avctx, AV_LOG_ERROR, "qscale has forbidden 0 value\n");
@@ -508,11 +505,8 @@ static int h261_decode_picture_header(H261Context *h)
skip_bits1(&s->gb); /* Reserved */
/* PEI */
- while (get_bits1(&s->gb) != 0) {
- skip_bits(&s->gb, 8);
- if (get_bits_left(&s->gb) <= 0)
- return AVERROR_INVALIDDATA;
- }
+ if (skip_1stop_8data_bits(&s->gb) < 0)
+ return AVERROR_INVALIDDATA;
/* H.261 has no I-frames, but if we pass AV_PICTURE_TYPE_I for the first
* frame, the codec crashes if it does not contain all I-blocks