[Ffmpeg-cvslog] r7794 - trunk/libavcodec/utils.c
takis
subversion
Thu Feb 1 10:45:06 CET 2007
Author: takis
Date: Thu Feb 1 10:45:05 2007
New Revision: 7794
Modified:
trunk/libavcodec/utils.c
Log:
Activate guards in avcodec_default_get_buffer. Patch by Michel Bardiaux,
mbardiaux mediaxim dot be.
Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c (original)
+++ trunk/libavcodec/utils.c Thu Feb 1 10:45:05 2007
@@ -237,8 +237,14 @@
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;
More information about the ffmpeg-cvslog
mailing list