[libdvbpsi-devel] examples/decode_mpeg.c: Fix (CID 17259)
Jean-Paul Saman
git at videolan.org
Wed Apr 16 15:53:33 CEST 2014
libdvbpsi | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | 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;
More information about the libdvbpsi-devel
mailing list