mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
get_buffers: Check that pix_fmt is not NONE.
This is somewhat redundant as no decoder should call get_buffer() with such argument. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8534881a38
commit
c250063523
2
ffmpeg.c
2
ffmpeg.c
@ -553,7 +553,7 @@ static int codec_get_buffer(AVCodecContext *s, AVFrame *frame)
|
|||||||
FrameBuffer *buf;
|
FrameBuffer *buf;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
if(av_image_check_size(s->width, s->height, 0, s))
|
if(av_image_check_size(s->width, s->height, 0, s) || s->pix_fmt<0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!ist->buffer_pool && (ret = alloc_buffer(s, ist, &ist->buffer_pool)) < 0)
|
if (!ist->buffer_pool && (ret = alloc_buffer(s, ist, &ist->buffer_pool)) < 0)
|
||||||
|
2
ffplay.c
2
ffplay.c
@ -1564,7 +1564,7 @@ static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
|
|||||||
w = codec->width;
|
w = codec->width;
|
||||||
h = codec->height;
|
h = codec->height;
|
||||||
|
|
||||||
if(av_image_check_size(w, h, 0, codec))
|
if(av_image_check_size(w, h, 0, codec) || codec->pix_fmt<0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
avcodec_align_dimensions2(codec, &w, &h, stride);
|
avcodec_align_dimensions2(codec, &w, &h, stride);
|
||||||
|
@ -414,7 +414,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(av_image_check_size(w, h, 0, s))
|
if(av_image_check_size(w, h, 0, s) || s->pix_fmt<0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!avci->buffer) {
|
if (!avci->buffer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user