You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02: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:
@@ -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");
|
||||||
|
Reference in New Issue
Block a user