mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
Activate guards in avcodec_default_get_buffer. Patch by Michel Bardiaux,
mbardiaux mediaxim dot be. Originally committed as revision 7794 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
541184974c
commit
65d999d6cf
@ -237,8 +237,14 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
|
||||
InternalBuffer *buf;
|
||||
int *picture_number;
|
||||
|
||||
assert(pic->data[0]==NULL);
|
||||
assert(INTERNAL_BUFFER_SIZE > s->internal_buffer_count);
|
||||
if(pic->data[0]!=NULL) {
|
||||
av_log(s, AV_LOG_ERROR, "pic->data[0]!=NULL in avcodec_default_get_buffer\n");
|
||||
return -1;
|
||||
}
|
||||
if(s->internal_buffer_count >= INTERNAL_BUFFER_SIZE) {
|
||||
av_log(s, AV_LOG_ERROR, "internal_buffer_count overflow (missing release_buffer?)\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(avcodec_check_dimensions(s,w,h))
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user