mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-18 12:56:56 +00:00
indeo: Properly forward the error codes
If the tile data size does not match the buffer size it did not return an AVERROR_INVALIDDATA causing futher corruption later. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
parent
1221bb6239
commit
7388c0c586
@ -778,8 +778,16 @@ static int decode_band(IVI45DecContext *ctx,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
result = ivi_decode_blocks(&ctx->gb, band, tile, avctx);
|
result = ivi_decode_blocks(&ctx->gb, band, tile, avctx);
|
||||||
if (result < 0 || ((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) {
|
if (result < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Corrupted tile data encountered!\n");
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
"Corrupted tile data encountered!\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
"Tile data_size mismatch!\n");
|
||||||
|
result = AVERROR_INVALIDDATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user