If the header is invalid, there is no need to get at buffer. Do it after the header has been checked. Suggested by Reimar Döffinger
The cpia video decoder is intended to be used with the v4l2 demuxer. There are some small changes to the v4l2 demuxer to support the variable frame length of the format. Fixes ticket #1537 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>