Re: [FFmpeg-devel] [PATCH 2/2] avcodec/utils: Check that the video data[] arrays are NULL on the input to get_buffer_internal()
On Fri, Feb 26, 2016 at 01:07:54PM +0100, Reimar Döffinger wrote: > On Fri, Feb 26, 2016 at 12:59:08PM +0100, Michael Niedermayer wrote: > > This should return an error to the decoder if the struct it tried to > > getbuffer is dirty > > It seems like a good idea, however it likely won't help > for programs providing their own getbuffer2 as they will > probably fill the data[] fields from their own shadow > structures, which this check will not discover. applied patchset thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you drop bombs on a foreign country and kill hundred thousands of innocent people, expect your government to call the consequence "unprovoked inhuman terrorist attacks" and use it to justify dropping more bombs and killing more people. The technology changed, the idea is old. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] avcodec/utils: Check that the video data[] arrays are NULL on the input to get_buffer_internal()
On Fri, Feb 26, 2016 at 12:59:08PM +0100, Michael Niedermayer wrote: > This should return an error to the decoder if the struct it tried to > getbuffer is dirty It seems like a good idea, however it likely won't help for programs providing their own getbuffer2 as they will probably fill the data[] fields from their own shadow structures, which this check will not discover. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] avcodec/utils: Check that the video data[] arrays are NULL on the input to get_buffer_internal()
This should return an error to the decoder if the struct it tried to getbuffer is dirty Signed-off-by: Michael Niedermayer--- libavcodec/utils.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index f8dee50..c7798e6 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -871,6 +871,11 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags) frame->height = FFMAX(avctx->height, AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres)); override_dimensions = 0; } + +if (frame->data[0] || frame->data[1] || frame->data[2] || frame->data[3]) { +av_log(avctx, AV_LOG_ERROR, "pic->data[*]!=NULL in get_buffer_internal\n"); +return AVERROR(EINVAL); +} } ret = ff_decode_frame_props(avctx, frame); if (ret < 0) -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel