FILE *stream;
if (NULL != (stream = fopen(OUTPUT_PARSE_FILE, "ab+")))
{
fwrite(pstParseVideoData->pucData,pstParseVideoData->ulDataLen,1, stream);
}
fclose(stream);
这段代码中fclose放在if语句外边,若NULL == (stream = fopen(OUTPUT_PARSE_FILE, "ab+"))(文件没有成功打开),再去调用fclose就回去关闭一个不存在的文件流。