{"action":"created","issue":{"url":"https://api.github.com/repos/jcodec/jcodec/issues/83","labels_url":"https://api.github.com/repos/jcodec/jcodec/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/jcodec/jcodec/issues/83/comments","events_url":"https://api.github.com/repos/jcodec/jcodec/issues/83/events","html_url":"https://github.com/jcodec/jcodec/issues/83","id":102887361,"number":83,"title":"Null Pointer Exception on decodeFrame","user":{"login":"astine","id":8030,"avatar_url":"https://avatars.githubusercontent.com/u/8030?v=3","gravatar_id":"","url":"https://api.github.com/users/astine","html_url":"https://github.com/astine","followers_url":"https://api.github.com/users/astine/followers","following_url":"https://api.github.com/users/astine/following{/other_user}","gists_url":"https://api.github.com/users/astine/gists{/gist_id}","starred_url":"https://api.github.com/users/astine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astine/subscriptions","organizations_url":"https://api.github.com/users/astine/orgs","repos_url":"https://api.github.com/users/astine/repos","events_url":"https://api.github.com/users/astine/events{/privacy}","received_events_url":"https://api.github.com/users/astine/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"svitvitskiy","id":4562428,"avatar_url":"https://avatars.githubusercontent.com/u/4562428?v=3","gravatar_id":"","url":"https://api.github.com/users/svitvitskiy","html_url":"https://github.com/svitvitskiy","followers_url":"https://api.github.com/users/svitvitskiy/followers","following_url":"https://api.github.com/users/svitvitskiy/following{/other_user}","gists_url":"https://api.github.com/users/svitvitskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/svitvitskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svitvitskiy/subscriptions","organizations_url":"https://api.github.com/users/svitvitskiy/orgs","repos_url":"https://api.github.com/users/svitvitskiy/repos","events_url":"https://api.github.com/users/svitvitskiy/events{/privacy}","received_events_url":"https://api.github.com/users/svitvitskiy/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-08-24T20:44:16Z","updated_at":"2015-09-01T22:40:19Z","closed_at":"2015-09-01T22:32:05Z","body":"Hello, I'm attempting to decode packets from an h264 stream in an mpeg-ts container. I'm getting a null pointer exception. \r\n\r\n```java\r\nFileChannelWrapper bc = new FileChannelWrapper(new FileInputStream(file).getChannel());\r\nSet<Integer> programs = MTSDemuxer.getPrograms(bc);\r\nfor (Integer program : programs) {\r\n                MTSDemuxer mts = new MTSDemuxer(bc, program);\r\n                for (MPEGDemuxer.MPEGDemuxerTrack track : mts.getTracks()) {\r\n                    DemuxerTrackMeta meta = track.getMeta();\r\n                    if(meta.getType() == DemuxerTrackMeta.Type.VIDEO) {\r\n                        ByteBuffer bb = ByteBuffer.allocate(5000);\r\n                        System.out.println(meta.getDimensions());\r\n                        int[][] out = new int[][] {new int[10000000], new int[10000000], new int[10000000]};\r\n                        Packet packet = track.nextFrame(bb);\r\n                        ByteBuffer data = packet.getData();\r\n                        VideoDecoder vd = JCodecUtil.detectDecoder(data);\r\n                        System.out.println(vd);\r\n                        data.rewind();\r\n                        Picture pic = vd.decodeFrame(data, out);\r\n//Throws: \r\n//error: java.lang.NullPointerException: null\r\n//org.jcodec.codecs.h264.H264Decoder$FrameDecoder.init(H264Decoder.java:126)\r\n//org.jcodec.codecs.h264.H264Decoder$FrameDecoder.decodeFrame(H264Decoder.java:87)\r\n//org.jcodec.codecs.h264.H264Decoder.decodeFrame(H264Decoder.java:58)\r\n//org.jcodec.codecs.h264.H264Decoder.decodeFrame(H264Decoder.java:41)\r\n                    } else if (meta.getType() == DemuxerTrackMeta.Type.AUDIO) {\r\n                        ByteBuffer bb = ByteBuffer.allocate(5000);\r\n                        Packet packet = track.nextFrame(bb);\r\n                    }\r\n                }\r\n            }\r\n```\r\n\r\nAm I missing something?"},"comment":{"url":"https://api.github.com/repos/jcodec/jcodec/issues/comments/136883353","html_url":"https://github.com/jcodec/jcodec/issues/83#issuecomment-136883353","issue_url":"https://api.github.com/repos/jcodec/jcodec/issues/83","id":136883353,"user":{"login":"svitvitskiy","id":4562428,"avatar_url":"https://avatars.githubusercontent.com/u/4562428?v=3","gravatar_id":"","url":"https://api.github.com/users/svitvitskiy","html_url":"https://github.com/svitvitskiy","followers_url":"https://api.github.com/users/svitvitskiy/followers","following_url":"https://api.github.com/users/svitvitskiy/following{/other_user}","gists_url":"https://api.github.com/users/svitvitskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/svitvitskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svitvitskiy/subscriptions","organizations_url":"https://api.github.com/users/svitvitskiy/orgs","repos_url":"https://api.github.com/users/svitvitskiy/repos","events_url":"https://api.github.com/users/svitvitskiy/events{/privacy}","received_events_url":"https://api.github.com/users/svitvitskiy/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T22:40:19Z","updated_at":"2015-09-01T22:40:19Z","body":"Also, there's a bug in JCodec related to 16bit signed overflow. So from your test video only around 30 frames will process.\r\nThis commit fixes it: 233dc0d7a4af8e06c49ff1a8da2bf816f58baf5e"}}