OSDN Git Service

test/encode/avcenc: close files
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 8 Jul 2011 05:07:23 +0000 (13:07 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Tue, 28 May 2013 08:46:48 +0000 (16:46 +0800)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
test/encode/avcenc.c

index 1de4fac..e999c77 100644 (file)
@@ -1295,6 +1295,7 @@ int main(int argc, char *argv[])
     frame_size = picture_width * picture_height +  ((picture_width * picture_height) >> 1) ;
 
     if ( (file_size < frame_size) || (file_size % frame_size) ) {
+        fclose(yuv_fp);
         printf("The YUV file's size is not correct\n");
         return -1;
     }
@@ -1303,6 +1304,7 @@ int main(int argc, char *argv[])
 
     avc_fp = fopen(argv[4], "wb");     
     if ( avc_fp == NULL) {
+        fclose(yuv_fp);
         printf("Can't open output avc file\n");
         return -1;
     }  
@@ -1347,5 +1349,8 @@ int main(int argc, char *argv[])
     release_encode_resource();
     destory_encode_pipe();
 
+    fclose(yuv_fp);
+    fclose(avc_fp);
+
     return 0;
 }