[DVDnav-discuss] r1291 - trunk/libdvdnav/src/vm/vm.c

rathann subversion at mplayerhq.hu
Thu Dec 5 00:02:01 CET 2013


Author: rathann
Date: Thu Dec  5 00:02:01 2013
New Revision: 1291

Log:
In vm_new_vm(), use the proper calloc() argument order

.. and don't derive 1 from the unrelated sizeof(char).

Fixes the scan-anaylzer "API violation" warning:
Result of 'calloc' is converted to a pointer of type 'vm_t', which is incompatible with sizeof operand type 'char'

Patch by Fabian Keil <fk AT fabiankeil DOT de>

Modified:
   trunk/libdvdnav/src/vm/vm.c

Modified: trunk/libdvdnav/src/vm/vm.c
==============================================================================
--- trunk/libdvdnav/src/vm/vm.c	Wed Dec  4 23:44:23 2013	(r1290)
+++ trunk/libdvdnav/src/vm/vm.c	Thu Dec  5 00:02:01 2013	(r1291)
@@ -263,7 +263,7 @@ static int ifoOpenNewVTSI(vm_t *vm, dvd_
 /* Initialisation & Destruction */
 
 vm_t* vm_new_vm() {
-  return (vm_t*)calloc(sizeof(vm_t), sizeof(char));
+  return (vm_t*)calloc(1, sizeof(vm_t));
 }
 
 void vm_free_vm(vm_t *vm) {


More information about the DVDnav-discuss mailing list