1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/h261dec: Use skip_1stop_8data_bits()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-10-30 18:28:00 +01:00
parent 9c284a8e19
commit 711e981276

View File

@ -125,11 +125,8 @@ static int h261_decode_gob_header(H261Context *h)
} }
/* GEI */ /* GEI */
while (get_bits1(&s->gb) != 0) { if (skip_1stop_8data_bits(&s->gb) < 0)
skip_bits(&s->gb, 8); return AVERROR_INVALIDDATA;
if (get_bits_left(&s->gb) <= 0)
return AVERROR_INVALIDDATA;
}
if (s->qscale == 0) { if (s->qscale == 0) {
av_log(s->avctx, AV_LOG_ERROR, "qscale has forbidden 0 value\n"); 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 */ skip_bits1(&s->gb); /* Reserved */
/* PEI */ /* PEI */
while (get_bits1(&s->gb) != 0) { if (skip_1stop_8data_bits(&s->gb) < 0)
skip_bits(&s->gb, 8); return AVERROR_INVALIDDATA;
if (get_bits_left(&s->gb) <= 0)
return AVERROR_INVALIDDATA;
}
/* H.261 has no I-frames, but if we pass AV_PICTURE_TYPE_I for the first /* 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 * frame, the codec crashes if it does not contain all I-blocks