assert(buffer);
ADM_assert(buffer);
int A_saveJpg (char *name){  ffmpegEncoderFFMjpeg *codec=NULL;  uint32_t sz,fl;  FILE *fd;  uint8_t *buffer=NULL;	sz = avifileinfo->width* avifileinfo->height * 3;	buffer=new uint8_t [sz];	assert(buffer);		codec=new  ffmpegEncoderFFMjpeg( avifileinfo->width,avifileinfo->height,FF_MJPEG)  ;		codec->init( 95,25000);		if(!codec->encode(rdr_decomp_buffer,				 	buffer,					&sz,					&fl))			{				GUI_Alert("Problem encoding that frame!");				delete [] buffer;				delete codec;				return 0;			}	fd=fopen(name,"wb");	if(!fd)	{				GUI_Alert("Problem opening file!");				delete [] buffer;				delete codec;				return 0;	}	fwrite (buffer, sz, 1, fd);    	fclose(fd);    	delete [] buffer;	delete codec;  	GUI_Alert ("Done.");	return 1;}