File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -717,6 +717,7 @@ int main(int argc, char *argv[])
717
717
bitmap = bitmap_alloc (info .width , info .height , BITMAP_FORMAT_YUY16 );
718
718
if (bitmap == NULL )
719
719
{
720
+ isavi ? close_avi (file ) : close_chd (file );
720
721
fprintf (stderr , "Out of memory creating %dx%d bitmap\n" , info .width , info .height );
721
722
return 1 ;
722
723
}
@@ -726,6 +727,12 @@ int main(int argc, char *argv[])
726
727
rsound = malloc (info .samplerate * sizeof (* rsound ));
727
728
if (lsound == NULL || rsound == NULL )
728
729
{
730
+ isavi ? close_avi (file ) : close_chd (file );
731
+ bitmap_free (bitmap );
732
+ if (rsound != NULL )
733
+ free (rsound );
734
+ if (lsound != NULL )
735
+ free (lsound );
729
736
fprintf (stderr , "Out of memory allocating sound buffers of %d bytes\n" , (INT32 )(info .samplerate * sizeof (* rsound )));
730
737
return 1 ;
731
738
}
You can’t perform that action at this time.
0 commit comments