mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-24 08:13:37 +00:00
avcodec/ivi_common: make while get_bits loop more robust by checking bits left
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
4b12930f79
commit
489c575bd6
@ -1042,7 +1042,12 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
*/
|
*/
|
||||||
if (avctx->codec_id == AV_CODEC_ID_INDEO4 &&
|
if (avctx->codec_id == AV_CODEC_ID_INDEO4 &&
|
||||||
ctx->frame_type == 0/*FRAMETYPE_INTRA*/) {
|
ctx->frame_type == 0/*FRAMETYPE_INTRA*/) {
|
||||||
while (get_bits(&ctx->gb, 8)); // skip version string
|
// skip version string
|
||||||
|
while (get_bits(&ctx->gb, 8)) {
|
||||||
|
if (get_bits_left(&ctx->gb) < 8)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
skip_bits_long(&ctx->gb, 64); // skip padding, TODO: implement correct 8-bytes alignment
|
skip_bits_long(&ctx->gb, 64); // skip padding, TODO: implement correct 8-bytes alignment
|
||||||
if (get_bits_left(&ctx->gb) > 18 && show_bits(&ctx->gb, 18) == 0x3FFF8)
|
if (get_bits_left(&ctx->gb) > 18 && show_bits(&ctx->gb, 18) == 0x3FFF8)
|
||||||
av_log(avctx, AV_LOG_ERROR, "Buffer contains IP frames!\n");
|
av_log(avctx, AV_LOG_ERROR, "Buffer contains IP frames!\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user