examples/decode_mpeg.c: Fix (CID 17259)
[email protected] (Jean-Paul Saman) Wed, 16 Apr 2014 15:53:33 +0200 (CEST)
| Newsgroups | gmane.comp.video.videolan.libdvbpsi.devel |
|---|---|
| Message-ID | <[email protected]> |
libdvbpsi | branch: master | Jean-Paul Saman <[email protected]> | Fri Apr 11 16:14:13 2014 +0200| [61a703977badf588ffb417e71d740c31d9273ff0] | committer: Jean-Paul Saman examples/decode_mpeg.c: Fix (CID 17259) Check i_fd to have a valid value. > http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=61a703977badf588ffb417e71d740c31d9273ff0 --- examples/decode_mpeg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/decode_mpeg.c b/examples/decode_mpeg.c index f60f217..1d9f4cb 100644 --- a/examples/decode_mpeg.c +++ b/examples/decode_mpeg.c @@ -665,6 +665,13 @@ int main(int i_argc, char* pa_argv[]) goto error; } + if( i_fd < 0 ) + { + fprintf( stderr, "no input selected\n" ); + usage( pa_argv[0] ); + goto error; + } + p_stream = (ts_stream_t *) malloc( sizeof(ts_stream_t) ); if( !p_stream ) goto out_of_memory; _______________________________________________ libdvbpsi-devel mailing list [email protected] https://mailman.videolan.org/listinfo/libdvbpsi-devel