Mercurial > libdvdread4.hg
annotate Makefile.am @ 91:23d412d59d62 src
Abort when PTT search table has zero entries
The static analyzer from LLVM/Clang 1:3.4~svn194079-1 reports a possible
allocation of size 0 in `libdvdread/src/ifo_read.c`.
$ scan-build -o scan-build make
$ scan-view scan-build/2013-11-18-155601-16168-1
When `vts_ptt_srpt->nr_of_srpts` is zero the allocation size is zero.
vts_ptt_srpt->title = malloc(vts_ptt_srpt->nr_of_srpts * sizeof(ttu_t));
The manual of the function `malloc` writes the following.
If size is 0, then malloc() returns either NULL, or a unique
pointer value that can later be successfully passed to free().
So check for 0 and, if it is, abort by going to the label `fail`.
Patch by Paul Menzel <paulepanter AT users DOT sourceforge DOT net>
author | rathann |
---|---|
date | Wed, 04 Dec 2013 22:40:17 +0000 |
parents | c743d79f187b |
children |
rev | line source |
---|---|
3 | 1 include $(top_srcdir)/misc/Makefile.common |
2 | |
15
7b2a843accd9
Rename includedir to $prefix/include/dvdread to remain API-compatible
rathann
parents:
5
diff
changeset
|
3 includedir = ${prefix}/include/dvdread |
3 | 4 |
5 | 5 AM_CPPFLAGS = -I$(top_srcdir)/src |
3 | 6 |
7 lib_LTLIBRARIES = libdvdread.la | |
8 | |
9 libdvdread_la_SOURCES = dvd_reader.c nav_read.c ifo_read.c \ | |
10 dvd_input.c dvd_udf.c md5.c nav_print.c ifo_print.c bitreader.c \ | |
11 bswap.h dvd_input.h dvdread_internal.h dvd_udf.h md5.h bitreader.h | |
12 | |
13 libdvdread_la_LIBADD = $(DYNAMIC_LD_LIBS) | |
14 | |
5 | 15 libdvdread_la_LDFLAGS = -version-info $(DVDREAD_LT_CURRENT):$(DVDREAD_LT_REVISION):$(DVDREAD_LT_AGE) \ |
3 | 16 -export-symbols-regex "(^dvd.*|^nav.*|^ifo.*|^DVD.*|^UDF.*)" |
17 | |
33
c743d79f187b
Move installed headers into dvdread directory to make them easier to
reimar
parents:
15
diff
changeset
|
18 include_HEADERS = dvdread/dvd_reader.h dvdread/nav_read.h dvdread/ifo_read.h \ |
c743d79f187b
Move installed headers into dvdread directory to make them easier to
reimar
parents:
15
diff
changeset
|
19 dvdread/nav_print.h dvdread/ifo_print.h dvdread/ifo_types.h dvdread/nav_types.h dvdread/dvd_udf.h dvdread/bitreader.h |