]> granicus.if.org Git - libvpx/blobdiff - y4minput.c
y4minput.c : removed malloc of 0 bytes to resolve warning
[libvpx] / y4minput.c
index 520c332480dd759d689a4cf7a29f08d76e09ff88..bcc742a2e43fbc86d1dc1775bb39c5e831fc744e 100644 (file)
@@ -700,7 +700,7 @@ static void y4m_convert_null(y4m_input *_y4m, unsigned char *_dst,
 
 int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip,
                    int only_420) {
-  char buffer[80];
+  char buffer[80] = {0};
   int  ret;
   int  i;
   /*Read until newline, or 80 cols, whichever happens first.*/
@@ -978,7 +978,9 @@ int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip,
     _y4m->dst_buf = (unsigned char *)malloc(_y4m->dst_buf_sz);
   else
     _y4m->dst_buf = (unsigned char *)malloc(2 * _y4m->dst_buf_sz);
-  _y4m->aux_buf = (unsigned char *)malloc(_y4m->aux_buf_sz);
+
+  if (_y4m->aux_buf_sz > 0)
+    _y4m->aux_buf = (unsigned char *)malloc(_y4m->aux_buf_sz);
   return 0;
 }