mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avcodec/omx: Check extradata size and nFilledLen
No testcase, its unknown if this is a real issue Reported-by: Peter Teoh <htmldeveloper@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
michaelni
parent
09ec2b397a
commit
fc8a614f3d
@@ -688,6 +688,11 @@ static av_cold int omx_encode_init(AVCodecContext *avctx)
|
||||
buffer = get_buffer(&s->output_mutex, &s->output_cond,
|
||||
&s->num_done_out_buffers, s->done_out_buffers, 1);
|
||||
if (buffer->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
|
||||
if (buffer->nFilledLen > INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE - avctx->extradata_size) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ret = av_reallocp(&avctx->extradata, avctx->extradata_size + buffer->nFilledLen + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
|
||||
avctx->extradata_size = 0;
|
||||
goto fail;
|
||||
|
||||
Reference in New Issue
Block a user