You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/utils: Clear dimensions in ff_get_buffer() on failure
Fixes out of array access Fixes: 482d8f2fd17c9f532b586458a33f267c/asan_heap-oob_4a52b6_7417_1d08d477736d66cdadd833d146bb8bae.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -888,8 +888,10 @@ end:
|
|||||||
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
|
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
|
||||||
{
|
{
|
||||||
int ret = get_buffer_internal(avctx, frame, flags);
|
int ret = get_buffer_internal(avctx, frame, flags);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
|
frame->width = frame->height = 0;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user