avcodec/g2meet: fix error returns
Fixes out of array accesses This should not affect any release Fixes: 8ab69af9e5a7a7e20fe04cdd25c0d6e7-asan_heap-oob_e72b82_5505_cov_2278389485_g2m4.wmv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0bf882864e
commit
6b53c1aa82
@ -717,7 +717,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Unknown compression method %d\n",
|
"Unknown compression method %d\n",
|
||||||
c->compression);
|
c->compression);
|
||||||
return AVERROR_PATCHWELCOME;
|
ret = AVERROR_PATCHWELCOME;
|
||||||
|
goto header_fail;
|
||||||
}
|
}
|
||||||
c->tile_width = bytestream2_get_be32(&bc);
|
c->tile_width = bytestream2_get_be32(&bc);
|
||||||
c->tile_height = bytestream2_get_be32(&bc);
|
c->tile_height = bytestream2_get_be32(&bc);
|
||||||
@ -737,7 +738,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
(chunk_size - 21) < 16 ) {
|
(chunk_size - 21) < 16 ) {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Display info: missing bitmasks!\n");
|
"Display info: missing bitmasks!\n");
|
||||||
return AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
|
goto header_fail;
|
||||||
}
|
}
|
||||||
r_mask = bytestream2_get_be32(&bc);
|
r_mask = bytestream2_get_be32(&bc);
|
||||||
g_mask = bytestream2_get_be32(&bc);
|
g_mask = bytestream2_get_be32(&bc);
|
||||||
@ -746,11 +748,13 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Invalid or unsupported bitmasks: R=%X, G=%X, B=%X\n",
|
"Invalid or unsupported bitmasks: R=%X, G=%X, B=%X\n",
|
||||||
r_mask, g_mask, b_mask);
|
r_mask, g_mask, b_mask);
|
||||||
return AVERROR_PATCHWELCOME;
|
ret = AVERROR_PATCHWELCOME;
|
||||||
|
goto header_fail;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
avpriv_request_sample(avctx, "bpp=%d", c->bpp);
|
avpriv_request_sample(avctx, "bpp=%d", c->bpp);
|
||||||
return AVERROR_PATCHWELCOME;
|
ret = AVERROR_PATCHWELCOME;
|
||||||
|
goto header_fail;
|
||||||
}
|
}
|
||||||
if (g2m_init_buffers(c)) {
|
if (g2m_init_buffers(c)) {
|
||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user