free (rdr_decomp_buffer);
delete  rdr_decomp_buffer;
int A_openAvi2 (char *name, uint8_t mode){  uint8_t res;  if (playing)    return 0;  /// check if name exists  FILE *fd;  fd = fopen (name, "rb");  if (!fd)    return 0;  fclose (fd);  if (avifileinfo)		// already opened ?    {				// delete everything      // if preview is on      if (mode_preview)	GUI_PreviewEnd ();      delete avifileinfo;      //delete wavinfo;      wavinfo = (WAVHeader *) NULL;      avifileinfo = (aviInfo *) NULL;      video_body->cleanup ();      curframe = 0;      currentaudiostream = NULL;      changeAudioStream (NULL, AudioNone);      filterCleanUp ();      if (rdr_decomp_buffer)	{	  free (rdr_decomp_buffer);	  rdr_decomp_buffer = NULL;	}    }  DIA_StartBusy ();  if (mode)    res = video_body->addFile (name, 1);  else    res = video_body->addFile (name);  DIA_StopBusy ();  // forget last project file  if( actual_workbench_file ){     free(actual_workbench_file);     actual_workbench_file = NULL;  }  if (res!=ADM_OK)			// an error occured    {    	if(ADM_IGN==res) 	{		return 0;	}	      currentaudiostream = NULL;      avifileinfo = NULL;      GUI_Alert ("Problem opening that file!");      return 0;    }    { int fd,i;      char magic[4];      char *longname = PathCanonize(name);	/* check myself it is a project file (transparent detected and read        ** by video_body->addFile (name);	*/	if( (fd = open(longname,O_RDONLY)) != -1 ){		if( read(fd,magic,4) == 4 ){			/* remember a workbench file */			if( !strncmp(magic,"ADMW",4) ){				actual_workbench_file = strdup(longname);			}		}		close(fd);	}	/* remember any video or workbench file to "recent" */	prefs->set_lastfile(longname);	updateLoaded ();	for(i=strlen(longname);i>=0;i--)#ifdef CYG_MANGLING		if( longname[i] == '\\' ){#else		if( longname[i] == '/' ){#endif			i++;			break;		}	UI_setTitle(longname+i);	free(longname);    }	return 1;}