If, for some reason, we couldn't create the decode context, exit, instead of segfaulting. Signed-off-by: Damien Lespiau <damien.lespiau@xxxxxxxxx> --- intel/test_decode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/intel/test_decode.c b/intel/test_decode.c index 93f47ef..1ffd829 100644 --- a/intel/test_decode.c +++ b/intel/test_decode.c @@ -182,6 +182,11 @@ main(int argc, char **argv) devid = infer_devid(argv[1]); ctx = drm_intel_decode_context_alloc(devid); + if (!ctx) { + fprintf(stderr, "Couldn't create decode context for 0x%04x\n", + devid); + exit(1); + } if (argc == 3) { if (strcmp(argv[2], "-dump") == 0) -- 1.8.3.1 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel