fix for out-of-bounds checks for fcurve modifier and poselib, also check for NULL members of avi structure (since they are checked for NULL later.)
This commit is contained in:
@@ -734,10 +734,11 @@ AviError AVI_close(AviMovie *movie)
|
|||||||
|
|
||||||
fclose(movie->fp);
|
fclose(movie->fp);
|
||||||
|
|
||||||
for (i = 0; i < movie->header->Streams; i++) {
|
for (i = 0; movie->header && (i < movie->header->Streams); i++) {
|
||||||
if (movie->streams[i].sf != NULL)
|
if (movie->streams && (movie->streams[i].sf != NULL)) {
|
||||||
MEM_freeN(movie->streams[i].sf);
|
MEM_freeN(movie->streams[i].sf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (movie->header != NULL)
|
if (movie->header != NULL)
|
||||||
MEM_freeN(movie->header);
|
MEM_freeN(movie->header);
|
||||||
@@ -1081,10 +1082,11 @@ AviError AVI_close_compress(AviMovie *movie)
|
|||||||
|
|
||||||
fclose(movie->fp);
|
fclose(movie->fp);
|
||||||
|
|
||||||
for (i = 0; i < movie->header->Streams; i++) {
|
for (i = 0; movie->header && (i < movie->header->Streams); i++) {
|
||||||
if (movie->streams[i].sf != NULL)
|
if (movie->streams && (movie->streams[i].sf != NULL)) {
|
||||||
MEM_freeN(movie->streams[i].sf);
|
MEM_freeN(movie->streams[i].sf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (movie->header != NULL)
|
if (movie->header != NULL)
|
||||||
MEM_freeN(movie->header);
|
MEM_freeN(movie->header);
|
||||||
if (movie->entries != NULL)
|
if (movie->entries != NULL)
|
||||||
|
@@ -966,7 +966,7 @@ FModifierTypeInfo *get_fmodifier_typeinfo(int type)
|
|||||||
|
|
||||||
/* only return for valid types */
|
/* only return for valid types */
|
||||||
if ((type >= FMODIFIER_TYPE_NULL) &&
|
if ((type >= FMODIFIER_TYPE_NULL) &&
|
||||||
(type <= FMODIFIER_NUM_TYPES) )
|
(type < FMODIFIER_NUM_TYPES))
|
||||||
{
|
{
|
||||||
/* there shouldn't be any segfaults here... */
|
/* there shouldn't be any segfaults here... */
|
||||||
return fmodifiersTypeInfo[type];
|
return fmodifiersTypeInfo[type];
|
||||||
|
@@ -1006,7 +1006,7 @@ static void poselib_preview_apply(bContext *C, wmOperator *op)
|
|||||||
/* get search-string */
|
/* get search-string */
|
||||||
index = pld->search_cursor;
|
index = pld->search_cursor;
|
||||||
|
|
||||||
if (index >= 0 && index <= sizeof(tempstr) - 1) {
|
if (index >= 0 && index < sizeof(tempstr) - 1) {
|
||||||
memcpy(&tempstr[0], &pld->searchstr[0], index);
|
memcpy(&tempstr[0], &pld->searchstr[0], index);
|
||||||
tempstr[index] = '|';
|
tempstr[index] = '|';
|
||||||
memcpy(&tempstr[index + 1], &pld->searchstr[index], (sizeof(tempstr) - 1) - index);
|
memcpy(&tempstr[index + 1], &pld->searchstr[index], (sizeof(tempstr) - 1) - index);
|
||||||
|
Reference in New Issue
Block a user