h264: fix detection of picture boundaries.