Commit a065c0a9 authored by conrad's avatar conrad

oggz-scan: handle out-of-memory

git-svn-id: http://svn.annodex.net/liboggz/trunk@3860 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent d0ab3b20
...@@ -332,6 +332,11 @@ main (int argc, char ** argv) ...@@ -332,6 +332,11 @@ main (int argc, char ** argv)
/* init osdata */ /* init osdata */
osdata = malloc (sizeof (OSData)); osdata = malloc (sizeof (OSData));
if (osdata == NULL) {
fprintf (stderr, "%s: Out of memory\n", progname);
exit (1);
}
memset (osdata, 0, sizeof (OSData)); memset (osdata, 0, sizeof (OSData));
osdata->read_packet = read_packet; osdata->read_packet = read_packet;
if (scan_keyframes) osdata->keyframes = 1; if (scan_keyframes) osdata->keyframes = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment